Skip to content

Commit

Permalink
Set metrics export interval to ten seconds
Browse files Browse the repository at this point in the history
Note that this is the export interval for metrics to be sent from
the OpenTelemetry application to the agent, not from the agent to
AppSignal's servers.

The default interval is set to sixty seconds -- when combined with
the agent's transmission interval, this introduces a delay of up to
two minutes in metrics being sent to AppSignal.

In addition, the histogram-to-distribution conversion that is
performed in the agent benefits from smaller batches of data for
greater accuracy.
  • Loading branch information
unflxw committed Mar 8, 2024
1 parent 65b0fc4 commit 9139f16
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/appsignal/opentelemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ def _start_opentelemetry_metrics(opentelemetry_port: str | int) -> None:
endpoint=f"http://localhost:{opentelemetry_port}/v1/metrics",
preferred_temporality=METRICS_PREFERRED_TEMPORALITY,
)
metric_reader = PeriodicExportingMetricReader(metric_exporter)
metric_reader = PeriodicExportingMetricReader(
metric_exporter,
export_interval_millis=10000
)

resource = Resource(attributes={"appsignal.service.process_id": os.getpid()})
provider = MeterProvider(resource=resource, metric_readers=[metric_reader])
Expand Down

0 comments on commit 9139f16

Please sign in to comment.