Skip to content

feat: Dynamic Metrics#17

Open
micrusa wants to merge 1 commit into
sanboxfrom
feat/dynamic-metrics
Open

feat: Dynamic Metrics#17
micrusa wants to merge 1 commit into
sanboxfrom
feat/dynamic-metrics

Conversation

@micrusa

@micrusa micrusa commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator
  • Add metrics.extraExporters to userConfig. Following changes only apply to extraExporters, not extraReaders
  • Add ignored metrics that do not get exported to userConfig defined
    exporters (they do get exported to user defined readers). Under POST/GET/DELETE /metrics/ignored
  • Add dynamic exporting interval for userConfig defined exporters (it's
    ignored for user defined readers). Under GET/POST /metrics/export-interval

Changes

  • Added extraExporters as configuration. These changes do not apply to extraReaders
  • The flow for extraExporters is DynamicPeriodicMetricReader -> FilterExporter -> MultiExporter -> extraExporters
  • Added routes for configuration of the feature, including filtering of metrics (ignored metrics) and new dynamic interval

Testing it out

  • To run new tests do npm run build & npm test

To test it manually, run dev environment with npm run dev

Dynamic intervals

  • Get current export interval: curl -X GET http://localhost:3000/oas-telemetry/metrics/export-interval
  • Update interval:
curl -X POST http://localhost:3000/oas-telemetry/metrics/export-interval \
		-H "Content-Type: application/json" \
		-d '{"exportIntervalMillis": 5000}'

Metric filtering (ignored scope names)

  • Get current ignore list: curl -X GET http://localhost:3000/oas-telemetry/metrics/ignored
  • Adding scopes:
curl -X POST http://localhost:3000/oas-telemetry/metrics/ignored \
		-H "Content-Type: application/json" \
		-d '{"metrics": ["scope1", "scope2"]}'
  • Removing specific scopes:
curl -X DELETE http://localhost:3000/oas-telemetry/metrics/ignored \
		-H "Content-Type: application/json" \
		-d '{"metric": "PetClinic"}'
  • Clearing ignore list: curl -X DELETE http://localhost:3000/oas-telemetry/metrics/ignored

- Add ignored metrics that do not get exported to userConfig defined
  exporters (they do get exported to user defined readers)
- Add dynamic exporting interval for userConfig defined exporters (it's
  ignored for user defined readers)
@motero2k

Copy link
Copy Markdown
Collaborator

I think we should take a closer look at the Views concept. Let's schedule a meeting to discuss the implementation.

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.

2 participants