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

UnknownFormatError: Unsupported content-type provided: text #24

Closed
szyn opened this issue Nov 8, 2018 · 2 comments
Closed

UnknownFormatError: Unsupported content-type provided: text #24

szyn opened this issue Nov 8, 2018 · 2 comments

Comments

@szyn
Copy link
Contributor

szyn commented Nov 8, 2018

Hi, I get the following error when using Datadog with Prometheus integration.

prometheus (3.0.0)
------------------
    Instance ID: prometheus:99fffad4f445db41 [ERROR]
    Total Runs: 2
    Metric Samples: 0, Total: 0
    Events: 0, Total: 0
    Service Checks: 1, Total: 2
    Average Execution Time : 17ms
    Error: Unsupported content-type provided: text
    Traceback (most recent call last):
    File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/datadog_checks/base/checks/base.py", line 366, in run
        self.check(copy.deepcopy(self.instances[0]))
    File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/datadog_checks/base/checks/prometheus/base_check.py", line 108, in check
        ignore_unmapped=True
    File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/datadog_checks/base/checks/prometheus/mixins.py", line 392, in process
        for metric in self.scrape_metrics(endpoint):
    File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/datadog_checks/base/checks/prometheus/mixins.py", line 366, in scrape_metrics
        for metric in self.parse_metric_family(response):
    File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/datadog_checks/base/checks/prometheus/mixins.py", line 235, in parse_metric_family
        response.headers['Content-Type']))
    UnknownFormatError: Unsupported content-type provided: text

The cause of the error is mimetype='text'.
https://github.com/epoch8/airflow-exporter/blob/master/prometheus_exporter.py#L125

As prometheus/client_python, we have better to use text/plain instead of text.

elephantum added a commit that referenced this issue Nov 13, 2018
@elephantum
Copy link
Contributor

@szyn thanks for reporting and fixing!

@szyn
Copy link
Contributor Author

szyn commented Nov 14, 2018

@elephantum Thank you, too!

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

No branches or pull requests

2 participants