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

problem with reading data from iot-device by prometheus-endpoint #14065

Open
auge02-git opened this issue May 8, 2024 · 0 comments
Open

problem with reading data from iot-device by prometheus-endpoint #14065

auge02-git opened this issue May 8, 2024 · 0 comments

Comments

@auge02-git
Copy link

What did you do?

I'm write a prometheus-endpoint on IoT device and prometheus throw a error to read data's from endpoint by is ending of \r and i'm found nothing options to replace or regex this on reading data from endpoint.

The original data is:

iot_sensor{date="8:54:15",sensor=0} 25.88
iot_sensor{date="8:54:15",sensor=1} 21.00

Bug-Report on Prometheus:

Endpoint State Labels Last Scrape Scrape Duration Error
http://10.x.y.z:80/metrics/ DOWN data_read="IoT of microcontroller"instance="10.x.y.z:80"job="iot-sensor"job_type="iot_sensor" 1m 3s ago 13.773s strconv.ParseFloat: parsing "25.88\r": invalid syntax

What did you expect to see?

The syntax on sensor-outputs "ok" on prometheus-endpoint. I hop to ignore line ending types and read data's, but coding on a C-dialect and using default print-function to output data's.

What did you see instead? Under which circumstances?

Enable ignore line-endings or replace option to allowed inputs.

System information

No response

Prometheus version

No response

Prometheus configuration file

global:
  scrape_interval:     15s # By default, scrape targets every 15 seconds.
  evaluation_interval: 15s # By default, scrape targets every 15 seconds.
  external_labels:
      monitor: 'my-project'

rule_files:
  - 'alert.rules'
  # - "first.rules"
  # - "second.rules"

# alert
alerting:
  alertmanagers:
  - scheme: http
    static_configs:
    - targets:
      - "alertmanager:9093"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.

  - job_name: 'prometheus'
    scrape_interval: 5s

    static_configs:
         - targets: ['localhost:9090']

  - job_name: 'cadvisor'
    scrape_interval: 5s
    dns_sd_configs:
    - names:
      - 'tasks.cadvisor'
      type: 'A'
      port: 8080

  - job_name: 'node-exporter'
    scrape_interval: 5s

    dns_sd_configs:
    - names:
      - 'tasks.node-exporter'
      type: 'A'
      port: 9100
    
  - job_name: 'iot-sensor'
    scrape_interval: 15s

    dns_sd_configs:
    - names:
      - 'tasks.iot-exporter'
      type: 'A'
      port: 29001

Alertmanager version

ALERTMANAGER_IMAGE_VERSION=latest

alertmanager:
    image: prom/alertmanager:${ALERTMANAGER_IMAGE_VERSION:-latest}

Version Information
Branch: HEAD
BuildDate: 20240228-11:51:20
BuildUser: root@22cd11f671e9
GoVersion: go1.21.7
Revision: 0aa3c2aad14cff039931923ab16b26b7481783b5
Version: 0.27.0

Alertmanager configuration file

No response

Logs

No response

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

1 participant