From 720f926258754bfaabb3893eff319a565f9b83ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Tudur=C3=AD?= Date: Wed, 4 Oct 2023 10:52:53 +0200 Subject: [PATCH] Use newer version of GitHub exporter (#5289) --- .../reference/components/prometheus.exporter.github.md | 2 +- .../configuration/integrations/github-exporter-config.md | 2 +- go.mod | 9 ++++++--- go.sum | 9 ++------- pkg/integrations/github_exporter/github_exporter.go | 4 ++-- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/docs/sources/flow/reference/components/prometheus.exporter.github.md b/docs/sources/flow/reference/components/prometheus.exporter.github.md index 61b6460a9d08..aab5f2ceb7dd 100644 --- a/docs/sources/flow/reference/components/prometheus.exporter.github.md +++ b/docs/sources/flow/reference/components/prometheus.exporter.github.md @@ -11,7 +11,7 @@ description: Learn about prometheus.exporter.github # prometheus.exporter.github The `prometheus.exporter.github` component embeds -[github_exporter](https://github.com/infinityworks/github-exporter) for collecting statistics from GitHub. +[github_exporter](https://github.com/githubexporter/github-exporter) for collecting statistics from GitHub. ## Usage diff --git a/docs/sources/static/configuration/integrations/github-exporter-config.md b/docs/sources/static/configuration/integrations/github-exporter-config.md index 750849b8b484..20f2027d78a0 100644 --- a/docs/sources/static/configuration/integrations/github-exporter-config.md +++ b/docs/sources/static/configuration/integrations/github-exporter-config.md @@ -10,7 +10,7 @@ description: Learn about github_exporter_config The `github_exporter_config` block configures the `github_exporter` integration, which is an embedded version of -[`github_exporter`](https://github.com/infinityworks/github-exporter). This allows for the collection of metrics from the GitHub api. +[`github_exporter`](https://github.com/githubexporter/github-exporter). This allows for the collection of metrics from the GitHub api. We strongly recommend that you configure a separate authentication token for the Agent, and give it only the strictly mandatory security privileges necessary for monitoring your repositories, as per the [official documentation](https://docs.github.com/en/rest/reference/permissions-required-for-github-apps). diff --git a/go.mod b/go.mod index 1e25e7844e09..9637d173f8cb 100644 --- a/go.mod +++ b/go.mod @@ -84,6 +84,7 @@ require ( github.com/iamseth/oracledb_exporter v0.0.0-20230504204552-f801dc432dcf github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab github.com/infinityworks/github-exporter v0.0.0-20210802160115-284088c21e7d + github.com/infinityworks/github-exporter v0.0.0-20210802160115-284088c21e7d github.com/influxdata/go-syslog/v3 v3.0.1-0.20210608084020-ac565dc76ba6 github.com/jaegertracing/jaeger v1.48.0 github.com/jmespath/go-jmespath v0.4.0 @@ -622,6 +623,11 @@ require ( sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect ) +require ( + github.com/githubexporter/github-exporter v0.0.0-20230925090839-9e31cd0e7721 + github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab +) + require ( dario.cat/mergo v1.0.0 // indirect github.com/Shopify/sarama v1.38.1 // indirect @@ -699,9 +705,6 @@ replace ( // https://github.com/grafana/cadvisor/tree/grafana-v0.47-noglobals github.com/google/cadvisor => github.com/grafana/cadvisor v0.0.0-20230927082732-0d72868a513e - // Upstream seems to be inactive, see https://github.com/grafana/agent/issues/1845 - github.com/infinityworks/github-exporter => github.com/grafana/github-exporter v0.0.0-20230418063919-fa34e926116a - // TODO(mattdurham): this is so you can debug on windows, when PR is merged into perflib, can you use that // and eventually remove if windows_exporter shifts to it. https://github.com/leoluk/perflib_exporter/pull/43 github.com/leoluk/perflib_exporter => github.com/grafana/perflib_exporter v0.1.1-0.20230511173423-6166026bd090 diff --git a/go.sum b/go.sum index e7bbac2debfc..6efc97fc4d2b 100644 --- a/go.sum +++ b/go.sum @@ -706,6 +706,8 @@ github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9 github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32/go.mod h1:GIjDIg/heH5DOkXY3YJ/wNhfHsQHoXGjl8G8amsYQ1I= +github.com/githubexporter/github-exporter v0.0.0-20230925090839-9e31cd0e7721 h1:QiyzldQ6CkWDD7sqSiPa0k++1xv48RMuoQi5pXoupa4= +github.com/githubexporter/github-exporter v0.0.0-20230925090839-9e31cd0e7721/go.mod h1:q49R4E4fu+HqGnSSSFpAuJIMm8DV5YNhKBW/Ke9SBPE= github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/glinton/ping v0.1.4-0.20200311211934-5ac87da8cd96/go.mod h1:uY+1eqFUyotrQxF1wYFNtMeHp/swbYRsoGzfcPZ8x3o= @@ -1052,8 +1054,6 @@ github.com/grafana/cloudflare-go v0.0.0-20230110200409-c627cf6792f2 h1:qhugDMdQ4 github.com/grafana/cloudflare-go v0.0.0-20230110200409-c627cf6792f2/go.mod h1:w/aiO1POVIeXUQyl0VQSZjl5OAGDTL5aX+4v0RA1tcw= github.com/grafana/dskit v0.0.0-20230829141140-06955c011ffd h1:RHZuBHWNS2HRJ5XhQK7cKP11EMMJPtJO2xKvQ+ws+PU= github.com/grafana/dskit v0.0.0-20230829141140-06955c011ffd/go.mod h1:3u7fr4hmOhuUL9Yc1QP/oa3za73kxvqJnRJH4BA5fOM= -github.com/grafana/github-exporter v0.0.0-20230418063919-fa34e926116a h1:pvi8kX3TWSQcdHNFDxUOyItgUqebu3vtbA2L/tMYX7w= -github.com/grafana/github-exporter v0.0.0-20230418063919-fa34e926116a/go.mod h1:6XoOvFDTfk3aqGaOLHLxoWiZNx4zHobApOhKc3oHF/g= github.com/grafana/go-gelf/v2 v2.0.1 h1:BOChP0h/jLeD+7F9mL7tq10xVkDG15he3T1zHuQaWak= github.com/grafana/go-gelf/v2 v2.0.1/go.mod h1:lexHie0xzYGwCgiRGcvZ723bSNyNI8ZRD4s0CLobh90= github.com/grafana/gocql v0.0.0-20200605141915-ba5dc39ece85/go.mod h1:crI9WX6p0IhrqB+DqIUHulRW853PaNFf7o4UprV//3I= @@ -1081,8 +1081,6 @@ github.com/grafana/pyroscope/ebpf v0.2.3 h1:OH7Un2x0UN998U85by4vyvImHs6mkFTo45Sn github.com/grafana/pyroscope/ebpf v0.2.3/go.mod h1:NO9mIMKewDuohQlYaj2Q0v3miUmREjGpadz8RuA76Jw= github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db h1:7aN5cccjIqCLTzedH7MZzRZt5/lsAHch6Z3L2ZGn5FA= github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db/go.mod h1:M5qHK+eWfAv8VR/265dIuEpL3fNfeC21tXXp9itM24A= -github.com/grafana/river v0.1.2-0.20230830200459-0ff21cf610eb h1:hOblg36rOTgGIOp7A3+53OtlXqq0iNnI9qDcOn7fPfQ= -github.com/grafana/river v0.1.2-0.20230830200459-0ff21cf610eb/go.mod h1:F8rcwfPL98xF/m+OSCFH7gJyLPYMIadXCVfY+/OcqEI= github.com/grafana/river v0.1.2-0.20231003183959-75f893ffa7df h1:jgguNFI2lCCOD49W1WS+TYHhN5KL5aTXTbn2N14tQVs= github.com/grafana/river v0.1.2-0.20231003183959-75f893ffa7df/go.mod h1:icSidCSHYXJUYy6TjGAi/D+X7FsP7Gc7cxvBUIwYMmY= github.com/grafana/smimesign v0.2.1-0.20220408144937-2a5adf3481d3 h1:UPkAxuhlAcRmJT3/qd34OMTl+ZU7BLLfOO2+NXBlJpY= @@ -1704,8 +1702,6 @@ github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnu github.com/nsqio/go-nsq v1.0.7/go.mod h1:XP5zaUs3pqf+Q71EqUJs3HYfBIqfK6G83WQMdNN+Ito= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/ohler55/ojg v1.19.2 h1:XvMP9oF6jo3T4eUyCsDwi3YFv0bGyQ4PvYBSMF9LiBM= -github.com/ohler55/ojg v1.19.2/go.mod h1:uHcD1ErbErC27Zhb5Df2jUjbseLLcmOCo6oxSr3jZxo= github.com/ohler55/ojg v1.19.3 h1:rFmEc33aZOvlwb7tibAmwVGEiPfMZkgvurK0YDDr1HI= github.com/ohler55/ojg v1.19.3/go.mod h1:uHcD1ErbErC27Zhb5Df2jUjbseLLcmOCo6oxSr3jZxo= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= @@ -2159,7 +2155,6 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= -github.com/steinfletcher/apitest v1.3.8/go.mod h1:LOVbGzWvWCiiVE4PZByfhRnA5L00l5uZQEx403xQ4K8= github.com/streadway/amqp v0.0.0-20180528204448-e5adc2ada8b8/go.mod h1:1WNBiOZtZQLpVAyu0iTduoJL9hEsMloAK5XWrtW0xdY= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= diff --git a/pkg/integrations/github_exporter/github_exporter.go b/pkg/integrations/github_exporter/github_exporter.go index 07af8f4fd2d1..580375b78c0a 100644 --- a/pkg/integrations/github_exporter/github_exporter.go +++ b/pkg/integrations/github_exporter/github_exporter.go @@ -4,13 +4,13 @@ import ( "fmt" "net/url" + gh_config "github.com/githubexporter/github-exporter/config" + "github.com/githubexporter/github-exporter/exporter" "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/grafana/agent/pkg/integrations" integrations_v2 "github.com/grafana/agent/pkg/integrations/v2" "github.com/grafana/agent/pkg/integrations/v2/metricsutils" - gh_config "github.com/infinityworks/github-exporter/config" - "github.com/infinityworks/github-exporter/exporter" config_util "github.com/prometheus/common/config" )