Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

otel-collector config to populate FAAS name #42

Merged
merged 1 commit into from
Dec 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions otel-collector/cmd/otel-collector/kodata/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ receivers:
static_configs:
# TODO: make this configurable
- targets: ["localhost:2112"]
# Do not relabel job and instance labels if existed.
honor_labels: true
metric_relabel_configs:
- source_labels: [ __name__ ]
regex: '^prometheus_.*'
Expand Down Expand Up @@ -39,17 +41,22 @@ processors:

resource:
attributes:
# add instance_id as a resource attribute
- key: service.instance.id
from_attribute: faas.id
# The `gcp` resourcedetection processor sets `faas.name` to the name of the
# Cloud Run service or the Cloud Run job.
- from_attribute: faas.name
# The googlemanagedprometheus exporter consumes `service.name` attribute
# and set the `job` resource label to this value. (See
# https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/pull/764)
key: "service.name"
action: upsert
# parse service name from K_SERVICE Cloud Run variable
- key: service.name
value: ${env:K_SERVICE}
action: insert

exporters:
googlemanagedprometheus:
sending_queue:
enabled: true
# we are handling metrics for a single pod, no need to have
# too many senders. this will also avoid out-of-order data.
num_consumers: 1

extensions:
health_check:
Expand Down
Loading