Repository navigation
Add configurable service name with OTEL env fallback - #28
Merged
Merged
Conversation
DavidTraina
force-pushed
the
fix/service-name-env-detection
branch
from
August 18, 2026 19:19
ec359a9 to
ca10cf9
Compare
bezbac
approved these changes
Aug 19, 2026
bezbac
left a comment
Member
There was a problem hiding this comment.
I have one minor nitpick, which I can also change myself. Otherwise, I’m very happy to merge this. Feel free to open the PR as you see fit.
DavidTraina
force-pushed
the
fix/service-name-env-detection
branch
from
August 19, 2026 17:43
ca10cf9 to
689e543
Compare
DavidTraina
marked this pull request as ready for review
August 19, 2026 17:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an optional
serviceNamesetting to the plugin config (config file orLANGFUSE_SERVICE_NAME) and makes the tracer provider honor the standard OpenTelemetry resource environment variables. Theservice.nameresource attribute on exported spans is resolved in this order:serviceNamefrom the plugin config (orLANGFUSE_SERVICE_NAME)OTEL_SERVICE_NAME/OTEL_RESOURCE_ATTRIBUTESunknown_service:node), unchanged from todayWhy
The plugin constructs a bare
NodeTracerProvider, which does not readOTEL_SERVICE_NAMEorOTEL_RESOURCE_ATTRIBUTESon its own, so every span was exported asunknown_service:nodewith no way to change it.service.nameidentifies the client emitting the telemetry, so both mechanisms are useful: the config option lets users name this plugin's traces explicitly (for example to tell OpenCode traffic apart from other clients reporting to the same Langfuse project), while the environment variables keep the standard OTel way of controlling resource attributes per deployment working as users would expect. An explicit config value wins over the environment; other resource attributes fromOTEL_RESOURCE_ATTRIBUTESstill apply either way.How tested
Extended the integration suite with a test that runs the built plugin against a local OTLP collector and asserts all three tiers: no configuration (default
unknown_serviceprefix, no extra attributes), environment variables only, and config overridingOTEL_SERVICE_NAMEwhileOTEL_RESOURCE_ATTRIBUTESvalues still apply.pnpm run test:integration(14 tests) andpnpm run format:checkpass.