Skip to content

Conversation

@richard-salac
Copy link
Contributor

@richard-salac richard-salac commented Nov 5, 2025

Description

Enables opentelemetry for modulith.

Opentelemetry features for apiml:

  • meant for testing integration with opentelemetry collector
  • disabled by default
  • can be enabled for modulith only
  • configurable via environment variables in zowe.yml
  • collects data about jvm and apiml endpoints (/gateway, /catalog, etc)
  • opentelemtry does not understand apiml specific features like routing or authentication (will come later)

Examples:

  • With microservices the opentelemetry is disabled
    log:
2025-11-05 13:58:30.278 <ZWEAAC1:main:33883226> �[35mZWESVUSR�[0;39m �[36mINFO �[0;39m ((i.o.i.s.a.OpenTelemetryAutoConfiguration)) OpenTelemetry Spring Boot starter has been disabled
2025-11-05 13:58:33.097 <ZWEADS1:main:50659729> �[35mZWESVUSR�[0;39m �[36mINFO �[0;39m ((i.o.i.s.a.OpenTelemetryAutoConfiguration)) OpenTelemetry Spring Boot starter has been disabled
2025-11-05 13:58:34.367 <ZWEAGW1:main:33883520> �[35mZWESVUSR�[0;39m �[36mINFO �[0;39m ((i.o.i.s.a.OpenTelemetryAutoConfiguration)) OpenTelemetry Spring Boot starter has been disabled
2025-11-05 13:58:35.300 <ZWEAZS1:main:84215387> �[35mZWESVUSR�[0;39m �[36mINFO �[0;39m ((i.o.i.s.a.OpenTelemetryAutoConfiguration)) OpenTelemetry Spring Boot starter has been disabled
  • With modulith the opentelemetry is disabled by default:
    log:
2025-11-05 14:34:00.021 <ZWEAGW1:main:50661657> �[35mZWESVUSR�[0;39m �[36mINFO �[0;39m ((i.o.i.s.a.OpenTelemetryAutoConfiguration)) OpenTelemetry Spring Boot starter has been disabled
  • With modulith and opentelemetry enabled:
    zowe.yml:
zowe:
  environments:
    OTEL_SDK_DISABLED: false
    OTEL_RESOURCE_ATTRIBUTES_DEPLOYMENT_ENVIRONMENT: dev
    OTEL_RESOURCE_ATTRIBUTES_SERVICE_NAME: apiml
    OTEL_RESOURCE_ATTRIBUTES_ZOS_SMF_ID: SYS1
    OTEL_RESOURCE_ATTRIBUTES_ZOS_SYSPLEX_NAME: SYSPLEX1
    OTEL_RESOURCE_ATTRIBUTES_MAINFRAME_LPAR_NAME: LPAR01
    OTEL_EXPORTER_OTLP_ENDPOINT: https://otel-collector:4318

components:
  apiml:
    enabled: true

log:

2025-11-05 13:53:10.769 <ZWEAGW1:main:50662327> �[35mZWESVUSR�[0;39m �[36mINFO �[0;39m ((i.o.i.s.a.OpenTelemetryAutoConfiguration)) OpenTelemetry Spring Boot starter (2.20.1) has been started

Implementation notes:

  • Brings Opentelemetry spring boot starter
  • The starter is automatically picked by all spring components as the libraries are shared with modulith and microservices
  • For all java components the opentelemetry is disabled in application.yml
    • in case the jar is not started via start.sh, rare cases for development and troubleshooting
  • For microservices, it is also disabled by cmd arguments in start.sh
    • cmd argument takes precedence over environment variable

Linked to # (issue)
Part of the # (epic)

Type of change

Please delete options that are not relevant.

  • fix: Bug fix (non-breaking change which fixes an issue)
  • feat: New feature (non-breaking change which adds functionality)
  • docs: Change in a documentation
  • refactor: Refactor the code
  • chore: Chore, repository cleanup, updates the dependencies.
  • BREAKING CHANGE or !: Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the style guidelines of this project
  • PR title conforms to commit message guideline ## Commit Message Structure Guideline
  • I have commented my code, particularly in hard-to-understand areas. In JS I did provide JSDoc
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The java tests in the area I was working on leverage @nested annotations
  • Any dependent changes have been merged and published in downstream modules

For more details about how should the code look like read the Contributing guideline

Signed-off-by: Richard Salac <richard.salac@broadcom.com>
@richard-salac richard-salac changed the title Enable opentelemetry for modulith Feature: Enable opentelemetry for modulith Nov 5, 2025
@richard-salac richard-salac changed the title Feature: Enable opentelemetry for modulith feat: Enable opentelemetry for modulith Nov 5, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 5, 2025

@richard-salac richard-salac merged commit 259a2fc into v3.x.x Nov 5, 2025
39 checks passed
@richard-salac richard-salac deleted the reboot/enable_opentelemetry branch November 5, 2025 17:06
Goutham024 pushed a commit to Joe-Winchester/api-layer-OIDC-POC that referenced this pull request Nov 6, 2025
Signed-off-by: Richard Salac <richard.salac@broadcom.com>
Signed-off-by: Gowtham Selvaraj <Gowtham.Selvaraj1@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Development

Successfully merging this pull request may close these issues.

3 participants