Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 6, 2026

Administrators need control over OpenTelemetry instrumentation to manage Application Insights costs, comply with privacy requirements, and optimize telemetry collection across environments.

Changes

Configuration Settings (8 exposed)

  • OTEL_SERVICE_NAME - Environment identification (e.g., simplechat-prod)
  • OTEL_TRACES_SAMPLER - Sampling strategy (always_on, traceidratio, parentbased_*)
  • OTEL_TRACES_SAMPLER_ARG - Sampling ratio (0.0-1.0, validated)
  • OTEL_PYTHON_FLASK_EXCLUDED_URLS - Regex patterns for endpoint exclusion
  • OTEL_PYTHON_DISABLED_INSTRUMENTATIONS - Selective instrumentation disable
  • OTEL_LOGS_EXPORTER / OTEL_METRICS_EXPORTER - Export destinations
  • Enable Live Metrics - Azure Monitor live stream toggle

Implementation

  • functions_appinsights.py - Reads settings and applies as environment variables before configure_azure_monitor()
  • route_frontend_admin_settings.py - Form handling with validation (sampler arg range check)
  • admin_settings.html - New "OpenTelemetry Configuration" section with dropdowns and tooltips
  • config.py - Version bump to 0.229.099

Documentation

  • docs/features/OPENTELEMETRY_CONFIGURATION.md - Technical reference with use cases, cost optimization strategies
  • docs/features/OPENTELEMETRY_QUICK_REFERENCE.md - Quick setup scenarios (production, dev, privacy-focused, external metrics)
  • functional_tests/test_otel_settings.py - 8 tests covering validation, mappings, scenarios

Example Configurations

Production (90% cost reduction):

otel_traces_sampler: "parentbased_traceidratio"
otel_traces_sampler_arg: "0.1"  # 10% sampling
otel_flask_excluded_urls: "healthcheck,/health,/external/health"

Privacy-focused (no DB query capture):

otel_disabled_instrumentations: "sqlalchemy,pymysql,psycopg2"

Settings persist in Cosmos DB, applied at startup. Application restart required for changes to take effect.

Original prompt

This section details on the original issue you should resolve

<issue_title>Review Open Telemetry settings to expose in admin settings</issue_title>
<issue_description>Review for implementation OTEL settings for FlaskInstrumentator to expose via the admin app settings, why they might want/need to be exposed, use cases for exposing each setting, etc.

Ex: OTEL_PYTHON_DISABLED_INSTRUMENTATIONS</issue_description>

<agent_instructions>Review and propose settings to expose in admin app settings for open telemetry FlaskInstrumentator. Include definitions for why an admin would need it exposed, and why they may want to toggle it on or off. Include the default setting. </agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 6, 2026 19:18
Co-authored-by: Bionic711 <13358952+Bionic711@users.noreply.github.com>
Co-authored-by: Bionic711 <13358952+Bionic711@users.noreply.github.com>
Co-authored-by: Bionic711 <13358952+Bionic711@users.noreply.github.com>
Copilot AI changed the title [WIP] Review Open Telemetry settings for admin exposure Expose OpenTelemetry configuration settings in admin interface Jan 6, 2026
Copilot AI requested a review from Bionic711 January 6, 2026 19:26
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.

Review Open Telemetry settings to expose in admin settings

2 participants