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

filters.flow.worker_millis_per_event.lifetime marshal error in 1.8 #372

Closed
VCCPlindsten opened this issue Oct 10, 2024 · 5 comments
Closed
Labels
bug Something isn't working

Comments

@VCCPlindsten
Copy link
Contributor

Description of the Issue

There is an error logged by logstash-exporter 1.8.0 relating to float marshaling. See logs below.

Only basic info gets exported to prometheus endpoint.

Version of logstash-exporter, or logstash-exporter Image

1.8.0

Version of Chart (if applicable)

No response

Operating System/Environment

Logstash 8.15.0

Logs

time=2024-10-10T12:49:14.807Z level=ERROR msg="executor failed" name=nodestats duration=25.028828ms err="json: cannot unmarshal string into Go struct field .pipelines.plugins.filters.flow.worker_millis_per_event.lifetime of type float64"
@VCCPlindsten VCCPlindsten added the bug Something isn't working label Oct 10, 2024
@fbs
Copy link

fbs commented Oct 11, 2024

same here, seems like the output format is:

$ curl -s 'localhost:9600/_node/stats?pretty=true' | jq '.pipelines.main.plugins.filters[1].flow '
  "worker_millis_per_event": {
    "last_1_minute": "Infinity",
    "last_5_minutes": "Infinity",
    "last_15_minutes": "Infinity",
    "last_1_hour": "Infinity",
    "lifetime": "Infinity"
  }

while the type accepts only floats:

			Flow struct {
				WorkerUtilization struct {
					Current  float64 `json:"current"`
					Lifetime float64 `json:"lifetime"`
				} `json:"worker_utilization"`
				WorkerMillisPerEvent struct {
					Lifetime float64 `json:"lifetime"`
				} `json:"worker_millis_per_event"`
			} `json:"flow"`

@fbs
Copy link

fbs commented Oct 11, 2024

Fixed in v1. Can you give it a go @VCCPlindsten ?

@VCCPlindsten
Copy link
Contributor Author

Seems to work as intended. (Or I didn't look closely enough) Not getting the error from the same logstash instance with current v1 code.

@VCCPlindsten
Copy link
Contributor Author

Fixed in 1.8.2

@satk0 satk0 reopened this Oct 17, 2024
@satk0
Copy link
Collaborator

satk0 commented Oct 17, 2024

Reopen as it is still needed to be implemented in v2. I'll take care of that

satk0 added a commit to satk0/logstash-exporter that referenced this issue Nov 29, 2024
kuskoman pushed a commit that referenced this issue Dec 1, 2024
* Add infinity float to nodestats, solve issue #372

* Calm down patchcov
@satk0 satk0 closed this as completed Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants