OpenTelemetry Bot d680729c09 [chore] Prepare release 0.90.0 (#29543) | 1 rok temu | |
---|---|---|
.. | ||
internal | 1 rok temu | |
testdata | 1 rok temu | |
DESIGN.md | 2 lat temu | |
Makefile | 3 lat temu | |
README.md | 1 rok temu | |
config.go | 1 rok temu | |
config_test.go | 1 rok temu | |
doc.go | 1 rok temu | |
factory.go | 1 rok temu | |
factory_test.go | 1 rok temu | |
go.mod | 1 rok temu | |
go.sum | 1 rok temu | |
metadata.yaml | 1 rok temu | |
metrics_receiver.go | 1 rok temu | |
metrics_receiver_helper_test.go | 1 rok temu | |
metrics_receiver_honor_timestamp_test.go | 1 rok temu | |
metrics_receiver_labels_test.go | 1 rok temu | |
metrics_receiver_metric_name_normalize_test.go | 1 rok temu | |
metrics_receiver_non_numerical_test.go | 1 rok temu | |
metrics_receiver_open_metrics_test.go | 1 rok temu | |
metrics_receiver_protobuf_test.go | 1 rok temu | |
metrics_receiver_report_extra_scrape_metrics_test.go | 1 rok temu | |
metrics_receiver_target_allocator_test.go | 1 rok temu | |
metrics_receiver_test.go | 1 rok temu | |
metrics_reciever_metric_rename_test.go | 1 rok temu | |
scrapeloop-flowchart.png | 3 lat temu |
Status | |
---|---|
Stability | beta: metrics |
Distributions | core, contrib, aws, grafana, observiq, splunk, sumo |
Issues | |
Code Owners | @Aneurysm9, @dashpole |
Receives metric data in Prometheus format. See the Design for additional information on this receiver.
Note: This component is currently work in progress. It has several limitations and please don't use it if the following limitations is a concern:
The Prometheus receiver is meant to minimally be a drop-in replacement for Prometheus. However, there are advanced features of Prometheus that we don't support and thus explicitly will return an error for if the receiver's configuration YAML/code contains any of the following
This receiver is a drop-in replacement for getting Prometheus to scrape your
services. It supports the full set of Prometheus configuration in scrape_config
,
including service discovery. Just like you would write in a YAML configuration
file before starting Prometheus, such as with:
Note: Since the collector configuration supports env variable substitution
$
characters in your prometheus configuration are interpreted as environment
variables. If you want to use $ characters in your prometheus configuration,
you must escape them using $$
.
prometheus --config.file=prom.yaml
Feature gates:
receiver.prometheusreceiver.UseCreatedMetric
: Start time for Summary, Histogram
and Sum metrics can be retrieved from _created
metrics. Currently, this behaviour
is disabled by default. To enable it, use the following feature gate option:
"--feature-gates=receiver.prometheusreceiver.UseCreatedMetric"
report_extra_scrape_metrics
: Extra Prometheus scrape metrics can be reported by setting this parameter to true
You can copy and paste that same configuration under:
receivers:
prometheus:
config:
For example:
receivers:
prometheus:
config:
scrape_configs:
- job_name: 'otel-collector'
scrape_interval: 5s
static_configs:
- targets: ['0.0.0.0:8888']
- job_name: k8s
kubernetes_sd_configs:
- role: pod
relabel_configs:
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
regex: "true"
action: keep
metric_relabel_configs:
- source_labels: [__name__]
regex: "(request_duration_seconds.*|response_duration_seconds.*)"
action: keep
The prometheus receiver also supports additional top-level options:
singing_duration_seconds_total
to be trimmed to singing_duration
. This can be useful when trying to restore the original metric names used in OpenTelemetry instrumentation. Defaults to false.For example,
receivers:
prometheus:
trim_metric_suffixes: true
use_start_time_metric: true
start_time_metric_regex: foo_bar_.*
config:
scrape_configs:
- job_name: 'otel-collector'
scrape_interval: 5s
static_configs:
- targets: ['0.0.0.0:8888']
Additional to this static job definitions this receiver allows to query a list of jobs from the OpenTelemetryOperators TargetAllocator or a compatible endpoint.
receivers:
prometheus:
target_allocator:
endpoint: http://my-targetallocator-service
interval: 30s
collector_id: collector-1
This receiver accepts exemplars coming in Prometheus format and converts it to OTLP format.
float64
formatms
span_id
in prometheus exemplars are set as OTLP span id
and labels with key trace_id
are set as trace id
This receiver drops the target_info
prometheus metric, if present, and uses attributes on
that metric to populate the OpenTelemetry Resource.
It drops otel_scope_name
and otel_scope_version
labels, if present, from metrics, and uses them to populate
the OpenTelemetry Instrumentation Scope name and version. It drops the otel_scope_info
metric,
and uses attributes (other than otel_scope_name
and otel_scope_version
) to populate Scope
Attributes.