Skip to content

Commit 7445a71

Browse files
[receiver/prometheus] feat: add Prometheus API server (#33875)
**Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> This is a new PR instead of this one: #32646 which has more relevant discussion. This PR adds the Prometheus API server as part of the Prometheus receiver if enabled through the receiver config. It supports calling the `/config`, `/targets`, `/targets/metadata`, `/scrape_pools`, and `/metrics` paths for more debugging information about the underlying Prometheus scrape manager and discovery manager. **Link to tracking Issue:** <Issue number if applicable> open-telemetry/prometheus-interoperability-spec#63 **Testing:** Added tests for the prometheus receiver configuration, for each path that the API supports, and for the server shutting down correctly. Also tested out with running the opentelemetry-collector agent with the prometheus receiver. **Documentation:** Added to the prometheus receiver README about how to configure the setting. --------- Co-authored-by: David Ashpole <[email protected]>
1 parent c74aea2 commit 7445a71

File tree

25 files changed

+1273
-312
lines changed

25 files changed

+1273
-312
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: enhancement
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: receiver/prometheus
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Adds the Prometheus API server to more easily debug the Prometheus config, service discovery, and targets.
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [32646]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: [user, api]

connector/datadogconnector/go.sum

Lines changed: 45 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

exporter/datadogexporter/go.mod

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,11 @@ require (
178178
github.com/Microsoft/go-winio v0.6.2 // indirect
179179
github.com/Showmax/go-fqdn v1.0.0 // indirect
180180
github.com/alecthomas/participle/v2 v2.1.1 // indirect
181-
github.com/alecthomas/units v0.0.0-20240626203959-61d1e3462e30 // indirect
181+
github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b // indirect
182182
github.com/antchfx/xmlquery v1.4.4 // indirect
183183
github.com/antchfx/xpath v1.3.3 // indirect
184184
github.com/armon/go-metrics v0.4.1 // indirect
185+
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
185186
github.com/aws/aws-sdk-go-v2 v1.36.3 // indirect
186187
github.com/aws/aws-sdk-go-v2/config v1.29.9 // indirect
187188
github.com/aws/aws-sdk-go-v2/credentials v1.17.62 // indirect
@@ -196,6 +197,7 @@ require (
196197
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.29.1 // indirect
197198
github.com/aws/aws-sdk-go-v2/service/sts v1.33.17 // indirect
198199
github.com/aws/smithy-go v1.22.2 // indirect
200+
github.com/bboreham/go-loser v0.0.0-20230920113527-fcc2c21820a3 // indirect
199201
github.com/benbjohnson/clock v1.3.5 // indirect
200202
github.com/beorn7/perks v1.0.1 // indirect
201203
github.com/bmatcuk/doublestar/v4 v4.8.1 // indirect
@@ -216,12 +218,14 @@ require (
216218
github.com/docker/go-units v0.5.0 // indirect
217219
github.com/dustin/go-humanize v1.0.1 // indirect
218220
github.com/ebitengine/purego v0.8.2 // indirect
221+
github.com/edsrzf/mmap-go v1.1.0 // indirect
219222
github.com/elastic/go-grok v0.3.1 // indirect
220223
github.com/elastic/lunes v0.1.0 // indirect
221224
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
222225
github.com/envoyproxy/go-control-plane/envoy v1.32.4 // indirect
223226
github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect
224227
github.com/expr-lang/expr v1.16.9 // indirect
228+
github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb // indirect
225229
github.com/fatih/color v1.18.0 // indirect
226230
github.com/felixge/httpsnoop v1.0.4 // indirect
227231
github.com/fsnotify/fsnotify v1.8.0 // indirect
@@ -231,10 +235,16 @@ require (
231235
github.com/go-logr/logr v1.4.2 // indirect
232236
github.com/go-logr/stdr v1.2.2 // indirect
233237
github.com/go-ole/go-ole v1.3.0 // indirect
238+
github.com/go-openapi/analysis v0.22.2 // indirect
239+
github.com/go-openapi/errors v0.22.0 // indirect
234240
github.com/go-openapi/jsonpointer v0.21.0 // indirect
235241
github.com/go-openapi/jsonreference v0.20.4 // indirect
242+
github.com/go-openapi/loads v0.21.5 // indirect
243+
github.com/go-openapi/spec v0.20.14 // indirect
244+
github.com/go-openapi/strfmt v0.23.0 // indirect
236245
github.com/go-openapi/swag v0.23.0 // indirect
237-
github.com/go-resty/resty/v2 v2.13.1 // indirect
246+
github.com/go-openapi/validate v0.23.0 // indirect
247+
github.com/go-resty/resty/v2 v2.15.3 // indirect
238248
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
239249
github.com/go-zookeeper/zk v1.0.4 // indirect
240250
github.com/gobwas/glob v0.2.3 // indirect
@@ -271,7 +281,7 @@ require (
271281
github.com/hashicorp/golang-lru v1.0.2 // indirect
272282
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
273283
github.com/hashicorp/hcl v1.0.1-vault-5 // indirect
274-
github.com/hashicorp/nomad/api v0.0.0-20240717122358-3d93bd3778f3 // indirect
284+
github.com/hashicorp/nomad/api v0.0.0-20241218080744-e3ac00f30eec // indirect
275285
github.com/hashicorp/serf v0.10.1 // indirect
276286
github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect
277287
github.com/hetznercloud/hcloud-go/v2 v2.13.1 // indirect
@@ -283,6 +293,7 @@ require (
283293
github.com/josharian/intern v1.0.0 // indirect
284294
github.com/jpillora/backoff v1.0.0 // indirect
285295
github.com/json-iterator/go v1.1.12 // indirect
296+
github.com/julienschmidt/httprouter v1.3.0 // indirect
286297
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect
287298
github.com/karrick/godirwalk v1.17.0 // indirect
288299
github.com/klauspost/compress v1.18.0 // indirect
@@ -300,6 +311,8 @@ require (
300311
github.com/mailru/easyjson v0.7.7 // indirect
301312
github.com/mattn/go-colorable v0.1.13 // indirect
302313
github.com/mattn/go-isatty v0.0.20 // indirect
314+
github.com/mdlayher/socket v0.4.1 // indirect
315+
github.com/mdlayher/vsock v1.2.1 // indirect
303316
github.com/miekg/dns v1.1.62 // indirect
304317
github.com/mitchellh/copystructure v1.2.0 // indirect
305318
github.com/mitchellh/go-homedir v1.1.0 // indirect
@@ -313,6 +326,7 @@ require (
313326
github.com/mostynb/go-grpc-compression v1.2.3 // indirect
314327
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
315328
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
329+
github.com/oklog/ulid v1.3.1 // indirect
316330
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.121.0 // indirect
317331
github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.121.0 // indirect
318332
github.com/open-telemetry/opentelemetry-collector-contrib/internal/docker v0.121.0 // indirect
@@ -341,10 +355,13 @@ require (
341355
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
342356
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
343357
github.com/prometheus-community/windows_exporter v0.27.2 // indirect
358+
github.com/prometheus/alertmanager v0.27.0 // indirect
344359
github.com/prometheus/client_golang v1.21.1 // indirect
345360
github.com/prometheus/client_model v0.6.1 // indirect
346361
github.com/prometheus/common v0.62.0 // indirect
362+
github.com/prometheus/common/assets v0.2.0 // indirect
347363
github.com/prometheus/common/sigv4 v0.1.0 // indirect
364+
github.com/prometheus/exporter-toolkit v0.13.0 // indirect
348365
github.com/prometheus/procfs v0.15.1 // indirect
349366
github.com/prometheus/prometheus v0.300.1 // indirect
350367
github.com/richardartoul/molecule v1.0.1-0.20240531184615-7ca0df43c0b3 // indirect
@@ -354,6 +371,7 @@ require (
354371
github.com/shirou/gopsutil/v3 v3.24.5 // indirect
355372
github.com/shirou/gopsutil/v4 v4.25.2 // indirect
356373
github.com/shoenig/go-m1cpu v0.1.6 // indirect
374+
github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c // indirect
357375
github.com/spf13/afero v1.11.0 // indirect
358376
github.com/spf13/cast v1.7.1 // indirect
359377
github.com/spf13/cobra v1.9.1 // indirect
@@ -371,6 +389,7 @@ require (
371389
github.com/vultr/govultr/v2 v2.17.2 // indirect
372390
github.com/x448/float16 v0.8.4 // indirect
373391
github.com/yusufpapurcu/wmi v1.2.4 // indirect
392+
go.mongodb.org/mongo-driver v1.14.0 // indirect
374393
go.opencensus.io v0.24.0 // indirect
375394
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
376395
go.opentelemetry.io/collector v0.121.1-0.20250307194215-7d3e03e500b0 // indirect
@@ -415,6 +434,7 @@ require (
415434
go.opentelemetry.io/collector/service/hostcapabilities v0.121.1-0.20250307194215-7d3e03e500b0 // indirect
416435
go.opentelemetry.io/contrib/bridges/otelzap v0.10.0 // indirect
417436
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0 // indirect
437+
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.56.0 // indirect
418438
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 // indirect
419439
go.opentelemetry.io/contrib/otelconf v0.15.0 // indirect
420440
go.opentelemetry.io/contrib/propagators/b3 v1.35.0 // indirect

0 commit comments

Comments
 (0)