elastic / elastic/integrations

[Discuss] Add `service.name` to service based integrations

Open
#6,295 7 comments 2 reactions 0 assignees View on GitHub
discuss enhancement Integration:kubernetes Integration:mongodb Integration:nginx Integration:postgresql Team:obs-ds-hosted-services Team:Obs-InfraObs
Dominant language
Handlebars
Stars
333
Forks
647
Avg merge
2d 17h
Merged PRs (30d)
225

Description

The concept of "services" is primarily used in APM but should not be limited to this domain. Other resources like databases, queues and web servers are also types of services that should be named.
Services in APM are identified using the ECS field [`service.name`](https://www.elastic.co/guide/en/ecs/current/ecs-service.html#field-service-name), and we can use this for identifying other types of services too.

Service-based integrations like Nginx, Postgresql and MongoDB ingest logs and metrics but the data is not annotated with `service.name`. There are 3 ways we can apply `service.name` to integrations:

- **Static**: "nginx" for the Nginx integration, "postgresql" for the Postgresql integration an so on
- **Inferred**: The service name can be inferred from standardized/known fields. For example, Kubernetes has recommended labels that "describe applications in a way that can be queried". The service name can therefore be derived from `app.kubernetes.io/name` if set.
- **Configurable**: The user can specify the service name they prefer at the time of installing the integration.

## Related
- Add `service.name` with the value of app.kubernetes.io/name label or kubernetes.container.name field, in this order of preference (https://github.com/elastic/integrations/pull/7118)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.