kezhenxu94 commented on PR #83: URL: https://github.com/apache/skywalking-showcase/pull/83#issuecomment-1273433355
> Prometheus set job_name to otel resource attributes as `service.name` , Skywalking convert it back to job_name . > > By testing , `OTEL_SERVICE_NAME` env couldn't cover `service.name` which set by Prometheus > > So , I couldn't leverage `service .name ` as skywalking service , I prefer add new attribute (e. g. skywalking_ service_name ) to otel as skywalking service identity , that would distinguish with job_name > > > > This is an example of otel collector processors configuration > > ```yaml > > processors: > > # https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/resourceprocessor/README.md > > resource/skywalking-service: > > attributes: > > - key: skywalking_service_name > > value: apisix-frontend > > action: insert > > ``` We are using job name to distinguish sources of the metrics, such as MySQL, postgresql, job name is not for setting service. Instead, we are using the service label to set the service name in SkyWalking. So this might work. ```yaml receivers: prometheus: config: scrape_configs: - job_name: 'apisix-monitoring' scrape_interval: 5s metrics_path: "/apisix/prometheus/metrics" static_configs: - targets: ['apisix:9091'] labels: service: apisix-frontend ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
