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

Set API Key in URL when submit distribution metrics #480

Merged
merged 2 commits into from
Nov 15, 2019

Conversation

tianchu
Copy link
Contributor

@tianchu tianchu commented Nov 14, 2019

api.Distribution.send no longer works after #446, as endpoint v1/distribution_points still expects the api key in the URL parameter than header.

To reproduce:

from datadog import initialize, api
options = {
    'api_key':'<API-KEY>',
    'app_key':'<APP-KEY>'
}
initialize(**options)

# submitting a regular metric point works
api.Metric.send(metric='my.test.metric', points=1)

# submitting a distribution metric point gets error 'No api key specified'
api.Distribution.send(distributions=[{
    'metric': 'my.dist.test',
    'points': [(1573757950, [1.0])],
    'host': None,
}])

@zippolyte
Copy link
Contributor

Looks like this should solve #479. Do you confirm @tianchu

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DataDog DataDog deleted a comment from azure-pipelines bot Nov 15, 2019
@zippolyte
Copy link
Contributor

The change looks good to me. This wasn't caught because we don't have integration tests for distributions. Would you mind adding some ?

@tianchu
Copy link
Contributor Author

tianchu commented Nov 15, 2019

Looks like this should solve #479. Do you confirm @tianchu

Correct, it should solve $479.

@tianchu
Copy link
Contributor Author

tianchu commented Nov 15, 2019

The change looks good to me. This wasn't caught because we don't have integration tests for distributions. Would you mind adding some ?

Makes sense. Let me look into it.

@tianchu tianchu force-pushed the tian.chu/fix-distribution-api branch from 74ff393 to c0f08e9 Compare November 15, 2019 19:21
@tianchu tianchu force-pushed the tian.chu/fix-distribution-api branch from c0f08e9 to 112868f Compare November 15, 2019 19:54
@nmuesch
Copy link
Contributor

nmuesch commented Nov 15, 2019

/azp run DataDog.datadogpy.integration

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@nmuesch nmuesch 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 fixing this and the initial test

@nmuesch nmuesch merged commit 09c0a95 into master Nov 15, 2019
@nmuesch nmuesch deleted the tian.chu/fix-distribution-api branch November 15, 2019 22:19
dabcoder pushed a commit to dabcoder/datadogpy that referenced this pull request Nov 28, 2019
* Set API Key in URL when submit distribution metrics

* Add integration test for distribution metric submission
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.

3 participants