Closed mohsenHa closed 3 months ago
I add these services to docker compose
After up local docker compose services you can access to each of them with bellow links:
grafana.ormuse.local prometheus.ormuse.local jaeger.ormuse.local
I also create an adapter to use to configure otel trace and metric and write an example for work with it.
otel
Usage:
First you need to configure otela package:
otela
import "github.com/ormushq/ormus/adapter/otela" var cfg = otela.Config{ Endpoint: "otel_collector:4317", EnableMetricExpose: true, MetricExposePath: "metrics", ServiceName: "test" MetricExposePort: 8081, } wg := &sync.WaitGroup{} done := make(chan bool) err := otela.Configure(wg, done, cfg) if err != nil { panic(err) }
After you configure the otela package you can use this for init new tracer and start a span:
tracer := otela.NewTracer("test-tracer") ctx, span := tracer.Start(ctx, "test-span2")
after done work you can close span
span.End()
For metric you can use this:
meter := otel.Meter("test-meter") counter, _ := meter.Float64Counter("test_counter") counter.Add(context.Background(), 1)
Jaeger trace preview
Grafana dashboard preview
I add these services to docker compose
After up local docker compose services you can access to each of them with bellow links:
I also create an adapter to use to configure
otel
trace and metric and write an example for work with it.Usage:
First you need to configure
otela
package:After you configure the
otela
package you can use this for init new tracer and start a span:after done work you can close span
For metric you can use this:
Jaeger trace preview
Grafana dashboard preview