Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jeremydvoss
Copy link
Member

@jeremydvoss jeremydvoss commented Apr 28, 2023

Removing the following parameters for configure_azure_monitor:

  • Exclude instrumentation
  • Resource
  • Disable logging
  • Disable metrics
  • Disable tracing
  • Logging level - not implemented yet
  • Logger name
  • Log export
  • Metric readers
  • Views
  • Sampling ratio
  • Trace export
  • Instrumentation config

Configuration for some of these items will still be possible through env vars.

@jeremydvoss jeremydvoss force-pushed the remove-configuration branch from 0f25e0b to fe17ac8 Compare May 2, 2023 01:30
@jeremydvoss jeremydvoss changed the title Remove all code configuration except conn str Remove most code configuration May 2, 2023
@jeremydvoss jeremydvoss force-pushed the remove-configuration branch from fe17ac8 to c09dd05 Compare May 2, 2023 17:34
@jeremydvoss jeremydvoss marked this pull request as ready for review May 2, 2023 18:25
@jeremydvoss jeremydvoss requested review from a team and lzchen as code owners May 2, 2023 18:25
@jeremydvoss jeremydvoss force-pushed the remove-configuration branch from a0d43c3 to 1a85a17 Compare May 2, 2023 21:42
@jeremydvoss jeremydvoss force-pushed the remove-configuration branch from 90a5b99 to 80472be Compare May 2, 2023 21:56
dep_mock.assert_called_with(ep2_mock.dist)
ep_mock.load.assert_not_called()
ep2_mock.load.assert_called_once()
instrumentor_mock.instrument.assert_called_once()
Copy link
Member Author

@jeremydvoss jeremydvoss May 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This diff turned out weird, but if you expand below, you'll see that I mainly just removed test_setup_instrumentations_lib_excluded, test_setup_instrumentations_custom_configuration, and test_setup_instrumentations_custom_configuration_excluded

| `OTEL_METRICS_EXPORTER` | If set to `None`, disables collection and export of metric telemetry. |
| `OTEL_LOGS_EXPORTER` | If set to `None`, disables collection and export of distributed tracing telemetry. |
| `OTEL_BLRP_SCHEDULE_DELAY` | Specifies the logging export interval in milliseconds. Defaults to 5000. |
| `OTEL_TRACES_SAMPLER_ARG` | 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. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Switch the ordering of the last two so OTEL_x_SCHEDULE_DELAY variables are grouped together.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

logger_name = configurations[LOGGER_NAME_ARG]
logging_level = configurations[LOGGING_LEVEL_ARG]
def _setup_logging(configurations: Dict[str, ConfigurationValue]):
# TODO: Remove after upgrading to 1.18
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean upgrading to opentelemetry-sdk 1.18 because it's in the latest release?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specified

def configure_azure_monitor(**kwargs) -> None:
"""
This function works as a configuration layer that allows the
end user to configure OpenTelemetry and Azure monitor components. The
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need InstrumentationConfig type above?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Will remove.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@lzchen
Copy link
Contributor

lzchen commented May 4, 2023

LGTM except a few comments.

@jeremydvoss jeremydvoss force-pushed the remove-configuration branch from e2abb45 to 97fb414 Compare May 4, 2023 21:01
@jeremydvoss jeremydvoss merged commit 4cc659a into microsoft:main May 4, 2023
@jeremydvoss jeremydvoss mentioned this pull request May 5, 2023
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.

2 participants