Skip to content

Conversation

@Geemal2004
Copy link

Added service_name configuration for OpenTelemetry.

Purpose

This PR fixes the issue where the Jaeger service name is undefined in Grafana dashboards, causing "Cannot read properties of undefined" errors when viewing traces. This resolves the inconsistency between the default WSO2-SYNAPSE service name and missing service name configuration in OpenTelemetry settings.

Goals

This fix introduces the missing service_name configuration in OpenTelemetry settings to ensure:

  • Traces are properly labeled with the correct service name "WSO2-SYNAPSE"
  • Grafana dashboards can display Jaeger traces without JavaScript errors
  • Seamless navigation from Grafana to Jaeger UI without manual service name changes
  • Consistent service naming across observability tools

Approach

The solution adds the missing service_name="WSO2-SYNAPSE" configuration to OpenTelemetry settings in:

  1. distribution/src/resources/config-tool/deployment-full.toml - Main configuration template
  2. distribution/src/resources/config-tool/default.json - Default values configuration

The fix ensures that when OpenTelemetry is enabled and configured to use Jaeger, the service name is properly set in the trace metadata, preventing undefined field errors in Grafana's trace visualization components.

User stories

As a DevOps engineer using Grafana dashboards to monitor WSO2 Micro Integrator traces:

  • I want to view Jaeger traces in Grafana without JavaScript errors
  • I want the service name to be correctly populated so I can filter and search traces effectively
  • I want to seamlessly navigate from Grafana trace panels to Jaeger UI without manual configuration

Release note

Fixed missing OpenTelemetry service name configuration that caused undefined serviceName errors in Grafana when viewing Jaeger traces. The service name is now properly set to "WSO2-SYNAPSE" for consistent observability across monitoring tools.

Documentation

N/A - This is an internal configuration fix that doesn't change user-facing APIs or functionality. The OpenTelemetry configuration documentation already covers the service_name parameter usage.

Training

N/A - No training content changes required as this is a bug fix for existing functionality.

Certification

N/A - This is a bug fix that doesn't introduce new features or change existing behavior that would impact certification content.

Marketing

N/A - Internal configuration fix with no marketing impact.

Automation tests

  • Unit tests

    No new unit tests required - this is a configuration change that fixes undefined field access

  • Integration tests

    Existing OpenTelemetry integration tests will validate the service name is properly set when tracing is enabled

Security checks

Samples

No sample changes required - the fix applies to the default configuration templates that samples inherit from.

Related PRs

None

Migrations (if applicable)

No migration required - this is a configuration addition that maintains backward compatibility. Existing deployments will continue to work, and new deployments will have the correct service name configured.

Test environment

Tested with:

  • OpenTelemetry enabled with Jaeger collector
  • Grafana with Jaeger datasource configured
  • WSO2 Micro Integrator generating traces
  • Verified that serviceName field is no longer undefined in Grafana trace panels

Learning

Research involved:

  • Analyzing Grafana's VirtualizedTraceView component source code to understand the serviceName field usage
  • Reviewing OpenTelemetry specification for service.name resource attribute
  • Examining WSO2 MI's JaegerTelemetryManager implementation to understand trace metadata handling
  • Testing with Jaeger and Grafana to reproduce and validate the fix

Files Changed

  • distribution/src/resources/config-tool/deployment-full.toml: Added service_name="WSO2-SYNAPSE"
  • distribution/src/resources/config-tool/default.json: Added "synapse_properties.'opentelemetry.service.name'": "WSO2-SYNAPSE"

Technical Details

Before:

[opentelemetry]
enable = false
host="localhost"
port="14250"
class="org.apache.synapse.aspects.flow.statistics.tracing.opentelemetry.management.JaegerTelemetryManager"

After:

[opentelemetry]
enable = false
host="localhost"
port="14250"
service_name="WSO2-SYNAPSE"
class="org.apache.synapse.aspects.flow.statistics.tracing.opentelemetry.management.JaegerTelemetryManager"

This ensures the OpenTelemetry SDK properly sets the service.name resource attribute, which Jaeger uses to populate the serviceName field that Grafana expects.

Added service_name configuration for OpenTelemetry.
@Geemal2004 Geemal2004 requested a review from rosensilva as a code owner October 7, 2025 20:02
@CLAassistant
Copy link

CLAassistant commented Oct 7, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants