Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
([#232](https://github.com/microsoft/ApplicationInsights-Python/pull/232))
- Add ability to pass custom configuration into instrumentations
([#235](https://github.com/microsoft/ApplicationInsights-Python/pull/235))
- Fix export interval bug
([#237](https://github.com/microsoft/ApplicationInsights-Python/pull/237))

## [1.0.0b8](https://github.com/microsoft/ApplicationInsights-Python/releases/tag/v1.0.0b8) - 2022-09-26

Expand Down
4 changes: 2 additions & 2 deletions azure-monitor-opentelemetry-distro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ You can use `configure_azure_monitor` to set up instrumentation for your app to
* disable_tracing - If set to `True`, disables collection and export of distributed tracing telemetry.
* logging_level - Specifies the [logging level][logging_level] of the Opentelemetry Logging Handler. Ex: logging.WARNING.
* logger_name = Specifies the [logger name][logger_name_hierarchy_doc] under which all logging will be instrumented. Defaults to "" which corresponds to the root logger.
* logging_export_interval_millis - Specifies the logging export interval in milliseconds. Defaults to 30,000.
* logging_export_interval_millis - Specifies the logging export interval in milliseconds. Defaults to 5000.
* views - Specifies the list of [views][opentelemetry_specification_view] to configure for the metric pipeline. See [here][ot_sdk_python_view_examples] for example usage.
* sampling_ratio - Specifies the ratio of distributed tracing telemetry to be [sampled][application_insights_sampling]. Accepted values are in the range [0,1]. Defaults to 1.0, meaning no telemetry is sampled out.
* tracing_export_interval_millis - Specifies the distributed tracing export interval in milliseconds. Defaults to 30,000.
* tracing_export_interval_millis - Specifies the distributed tracing export interval in milliseconds. Defaults to 5000.

#### Exporter configurations

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def _get_resource(configurations: Dict[str, Any]) -> Resource:
def _setup_tracing(resource: Resource, configurations: Dict[str, Any]):
sampling_ratio = configurations.get("sampling_ratio", 1.0)
tracing_export_interval_millis = configurations.get(
"tracing_export_interval_millis", 30000
"tracing_export_interval_millis", 5000
)
tracer_provider = TracerProvider(
sampler=ApplicationInsightsSampler(sampling_ratio=sampling_ratio),
Expand All @@ -103,7 +103,7 @@ def _setup_tracing(resource: Resource, configurations: Dict[str, Any]):
trace_exporter = AzureMonitorTraceExporter(**configurations)
span_processor = BatchSpanProcessor(
trace_exporter,
export_timeout_millis=tracing_export_interval_millis,
schedule_delay_millis=tracing_export_interval_millis,
)
get_tracer_provider().add_span_processor(span_processor)

Expand All @@ -112,14 +112,14 @@ def _setup_logging(resource: Resource, configurations: Dict[str, Any]):
logger_name = configurations.get("logger_name", "")
logging_level = configurations.get("logging_level", NOTSET)
logging_export_interval_millis = configurations.get(
"logging_export_interval_millis", 30000
"logging_export_interval_millis", 5000
)
logger_provider = LoggerProvider(resource=resource)
set_logger_provider(logger_provider)
log_exporter = AzureMonitorLogExporter(**configurations)
log_record_processor = BatchLogRecordProcessor(
log_exporter,
export_timeout_millis=logging_export_interval_millis,
schedule_delay_millis=logging_export_interval_millis,
)
get_logger_provider().add_log_record_processor(log_record_processor)
handler = LoggingHandler(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def test_setup_tracing(
get_tracer_provider_mock.assert_called()
trace_exporter_mock.assert_called_once()
bsp_mock.assert_called_once_with(
trace_exp_init_mock, export_timeout_millis=15000
trace_exp_init_mock, schedule_delay_millis=15000
)
tp_init_mock.add_span_processor(bsp_init_mock)

Expand Down Expand Up @@ -352,7 +352,7 @@ def test_setup_logging(
get_logger_provider_mock.assert_called()
log_exporter_mock.assert_called_once()
blrp_mock.assert_called_once_with(
log_exp_init_mock, export_timeout_millis=10000
log_exp_init_mock, schedule_delay_millis=10000
)
lp_init_mock.add_log_record_processor.assert_called_once_with(
blrp_init_mock
Expand Down