Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Configuration #1523

Merged
merged 30 commits into from
Jan 30, 2021
Merged

Remove Configuration #1523

merged 30 commits into from
Jan 30, 2021

Conversation

ocelotl
Copy link
Contributor

@ocelotl ocelotl commented Jan 12, 2021

Remove Configuration from everywhere.

Fixes #1494

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A

Does This PR Require a Contrib Repo Change?

Answer the following question based on these examples of changes that would require a Contrib Repo Change:

  • The OTel specification has changed which prompted this PR to update the method interfaces of opentelemetry-api/ or opentelemetry-sdk/

  • The method interfaces of opentelemetry-instrumentation/ have changed

  • The method interfaces of test/util have changed

  • Scripts in scripts/ that were copied over to the Contrib repo have changed

  • Configuration files that were copied over to the Contrib repo have changed (when consistency between repositories is applicable) such as in

    • pyproject.toml
    • isort.cfg
    • .flake8
  • When a new .github/CODEOWNER is added

  • Major changes to project information, such as in:

    • README.md
    • CONTRIBUTING.md
  • Yes. - Link to PR: Remove Configuration from instrumentations opentelemetry-python-contrib#285

  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@ocelotl ocelotl requested a review from a team January 12, 2021 06:15
@ocelotl ocelotl self-assigned this Jan 12, 2021
@ocelotl ocelotl requested review from owais and lzchen and removed request for a team January 12, 2021 06:15
@ocelotl ocelotl force-pushed the issue_1494 branch 2 times, most recently from 5a584e8 to 8c69947 Compare January 12, 2021 06:18
@lzchen
Copy link
Contributor

lzchen commented Jan 13, 2021

Now that we are removing the Configuration API, should we have a single place where all of the env variables are defined?

Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

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

This looks great. Please update the changelog.

CHANGELOG.md Show resolved Hide resolved
@ocelotl
Copy link
Contributor Author

ocelotl commented Jan 19, 2021

Now that we are removing the Configuration API, should we have a single place where all of the env variables are defined?

Hm, maybe...

But how would this work? Having a file with something like this:

# environment_variables.py

OTEL_PROPAGATORS = "OTEL_PROPAGATORS"
OTEL_TRACE_EXPORTER = "OTEL_TRACE_EXPORTER"
...

for other Python modules to do from opentelemetry.environment_variables import OTEL_PROPAGATORS?

We could do that, but is there any value in having that file? We pretty much are only defining constants that are named exactly after strings.

Should we include all the environment variables defined in the spec (that would make us have to keep this hypothetical file updated with the spec)?

@ocelotl ocelotl force-pushed the issue_1494 branch 2 times, most recently from 910986e to 73929d2 Compare January 21, 2021 16:09
@aabmass
Copy link
Member

aabmass commented Jan 21, 2021

We should be able to generate these with that semconvgen tool eventually. The nice thing there is it updates from the spec with new/modified envvars.

We can also add sphinx docstrings in the generated code to document the envvars with .. envvar directive

@ocelotl ocelotl force-pushed the issue_1494 branch 5 times, most recently from ef8974b to 3123115 Compare January 22, 2021 22:16
Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

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

A few changes requested and some questions. Thanks for cleaning up the PR!

@ocelotl ocelotl marked this pull request as draft January 25, 2021 18:34
@ocelotl
Copy link
Contributor Author

ocelotl commented Jan 25, 2021

I have been trying pretty much anything to fix the documentation issue. Tests pass in my laptop but fail in CI, so there will be some weird commits from my side while I try to fix this. Moving this PR to draft in the meantime, to reflect this, but feel free to leave comments if you feels like it, sorry for the inconveniences.

@codeboten
Copy link
Contributor

Worth noting that this also fixes #1554

### Removed
- Remove Configuration
([#1523](https://github.com/open-telemetry/opentelemetry-python/pull/1523))

Copy link
Contributor

Choose a reason for hiding this comment

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

we should probably also add a changelog note about the changing variable names

### Removed
- Remove Configuration
([#1523](https://github.com/open-telemetry/opentelemetry-python/pull/1523))

Copy link
Contributor

Choose a reason for hiding this comment

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

should also contain a note about the changing args in opentelemetry-instrument

Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

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

Thanks for address my comments. I'll approve, but would like to see the updates to the changelog before merging

Base automatically changed from master to main January 29, 2021 16:49

with patch("sys.argv", ["instrument", "-s", "my-service", "1", "2"]):
auto_instrumentation.run()
self.assertEqual(environ.get("OTEL_SERVICE_NAME"), "my-service")
self.assertEqual(
environ.get(OTEL_PYTHON_SERVICE_NAME), "my-service"
Copy link
Member

Choose a reason for hiding this comment

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

Probably not in this PR scope. I believe this is used for exporter service_name param. Shouldn't we remove this env and service_name arg and rely on Resource attributes for service name.

OTEL_BSP_EXPORT_TIMEOUT,
OTEL_BSP_MAX_EXPORT_BATCH_SIZE,
OTEL_BSP_MAX_QUEUE_SIZE,
OTEL_BSP_SCHEDULE_DELAY,
Copy link
Member

Choose a reason for hiding this comment

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

Nice, didn't know you removed the _MILLIS in this PR itself. That was updated very recently in the spec. I should close #1554

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.

Need to decide what to do w/ the Configuration API
6 participants