ballerina-lang icon indicating copy to clipboard operation
ballerina-lang copied to clipboard

[New Feature]: Design new configurations for ballerina observability (automatic instrumentation)

Open NipunaMadhushan opened this issue 1 year ago • 2 comments

Description

Currently, we need to configure the following to enable observability features.

Ballerina.toml -

[build-options]
observabilityIncluded=true

Config.toml -

[ballerina.observe]
metricsEnabled=true
metricsReporter="prometheus"
tracingEnabled=true
tracingProvider="jaeger"

bal file -

import ballerinax/prometheus as _;
import ballerinax/jaeger as _;

But in terms of automatic instrumentation there should not be any module we need to import in the code level. Observability should be enabled only via configurations in automatic instrumentation. Therefore we need to change the current design of enabling observability. We need to import the tracingProvider or metricsReporter by reading the configurations.

observability-symbols.jar is also generated when observability is enabled which contains syntax-tree.json. It was previously used by Choreo. But now they do not need the jar as they removed the observability features related to ballerina. Therefore now we should add another configuration to check whether to generate the observability-symbols.jar or not.

Describe your problem(s)

No response

Describe your solution(s)

No response

Related area

-> Observability

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

NipunaMadhushan avatar Jan 02 '24 09:01 NipunaMadhushan

New design for ballerina observability configurations has been explained in here.

NipunaMadhushan avatar Jan 04 '24 11:01 NipunaMadhushan

As part of the design to have multiple tracer providers and metric providers, I did research on how to provide trace and metrics data multiple providers.

For tracing, we can set multiple exporters via span processors to the SdkTracerProvider. Then the same tracing data will be stored in two different span exporters until the tracer providers collect data.

Similarly we can do the same for metrics with the new metrics implementation with opentelemetry as mentioned in https://github.com/ballerina-platform/ballerina-lang/issues/42317.

NipunaMadhushan avatar Mar 20 '24 06:03 NipunaMadhushan