Skip to content

Commit a1bbdc1

Browse files
Enhance README with service_name details (#44073)
#### Description Added service_name configuration for GitHub actions and clarified precedence for setting service.name. #### Link to tracking issue Fixes #44072 #### Documentation The docs are: - Explicitly stating what service.name represents per the OTel Resource semantic conventions. - Recommending an explicit service_name (e.g., github-actions) for CI platforms. - Positioning the repo-derived default as a convenience for small setups—not as a best practice for larger organizations. - Showing how to use repository Custom Properties only when distinct repos truly map to distinct services. Co-authored-by: Alex Boten <[email protected]>
1 parent 78468f8 commit a1bbdc1

File tree

1 file changed

+28
-17
lines changed

1 file changed

+28
-17
lines changed

receiver/githubreceiver/README.md

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ receivers:
174174
path: /events
175175
health_path: /health
176176
secret: ${env:SECRET_STRING_VAR}
177+
service_name: github-actions # single logical CI service (See Configuring Service Name section below)
177178
required_headers:
178179
WAF-Header: "value"
179180
scrapers: # The validation expects at least a dummy scraper config
@@ -188,24 +189,34 @@ of exposed configuration values can be found in [`config.go`](./config.go).
188189

189190
The `service_name` option in the WebHook configuration can be used to set a
190191
pre-defined `service.name` resource attribute for all traces emitted by the
191-
receiver. This takes priority over the internal generation of the
192-
`service.name`. In this configuration, it would be important to create a GitHub
193-
receiver per GitHub app configured for the set of repositories that match your
194-
`service.name`.
195-
196-
However, a more efficient approach would be to leverage the default generation
197-
of `service.name` by configuring [Custom Properties][cp] in each GitHub
198-
repository. To do that simply add a `service_name` key with the desired value in
199-
each repository and all events sent to the GitHub receiver will properly
200-
associate with that `service.name`. Alternatively, the `service_name` will be
201-
derived from the repository name.
202-
203-
The precedence for setting the `service.name` resource attribute is as follows:
204-
205-
1. `service_name` configuration in the WebHook configuration.
206-
2. `service_name` key in the repository's Custom Properties per repository.
192+
receiver. This value should represent the **logical service producing telemetry**
193+
(as defined by OpenTelemetry resource semantics), not individual repositories or
194+
components. For CI/CD usage, a typical choice is a single service such as
195+
`github-actions` (optionally paired with `service.namespace` for ownership and
196+
uniqueness).
197+
198+
If you choose to set `service_name` explicitly, consider running a separate
199+
GitHub receiver (and/or GitHub App) for each distinct service that you want to
200+
model.
201+
202+
If you do not set `service_name`, the receiver supports deriving it from
203+
repository metadata. You can configure [Custom Properties][cp] in each GitHub
204+
repository by adding a `service_name` key; all events from that repository will
205+
then carry the specified `service.name`. If no custom property is found, the
206+
receiver will derive `service.name` from the repository name.
207+
208+
> **Note:** Deriving `service.name` from repositories is a convenience and may
209+
> be sufficient for small setups. In larger organizations, mapping repositories
210+
> directly to `service.name` often leads to many pseudo-services and can make
211+
> cross-repository analysis harder. Prefer an explicit CI service name when
212+
> modeling your pipelines as a platform service.
213+
214+
**Precedence for setting `service.name`:**
215+
216+
1. `service_name` in the WebHook configuration.
217+
2. `service_name` key in the repository’s Custom Properties.
207218
3. `service_name` derived from the repository name.
208-
4. `service.name` set to `unknown_service` per the semantic conventions as a fall back.
219+
4. `service.name` defaults to `unknown_service` per the semantic conventions.
209220

210221
### Span Events
211222

0 commit comments

Comments
 (0)