github_exporter icon indicating copy to clipboard operation
github_exporter copied to clipboard

Failed to parse github event (field custom_properties)

Open ardole opened this issue 1 year ago • 3 comments

When using webhook to export workflows event, i got the following error in the exporter:

{"error":"json: cannot unmarshal array into Go struct field Repository.repository.custom_properties of type string","level":"error","msg":"failed to parse github event"...

It looks like the json format send by Github is not the one you expect, especially on field custom_properties. I may come from https://github.com/google/go-github/issues/3229 which was fixed, then i think that you have updated the dependency as well.

I'm using the HelmChart and it runs the version

Image:          quay.io/promhippie/github-exporter:3.1.2                                                                                                                               │
Image ID:       quay.io/promhippie/github-exporter@sha256:25eb9b1a7ac7bd82d3fe59ae3ee59abf6da61d8fc2b0d32d3a0945269b4a4a4d

What can happen, is the image not fully up to date ?

ardole avatar Sep 20 '24 13:09 ardole

Thanks for reporting this. Can you verify that the latest tag fixes the issue?

Than it's really just doing a new release to include the fix of the go library.

tboerger avatar Sep 20 '24 16:09 tboerger

That's it, latest is working :) Thank you

ardole avatar Sep 20 '24 16:09 ardole

Thanks for the confirmation, I will check if there are other changes that got to be added and hopefully provide a new release next week.

tboerger avatar Sep 21 '24 08:09 tboerger

This should be resolved with the release of v4.0.0, if something is missing or not working please raise an issue. The release should pop up in a few minutes.

tboerger avatar Oct 23 '24 21:10 tboerger

This should be resolved with the release of v4.0.0, if something is missing or not working please raise an issue. The release should pop up in a few minutes.

I'm not able to test it right now.

I'm facing a new issue, when trying to call the webhook with the path from GITHUB_EXPORTER_WEBHOOK_PATH i get a 301 redirect to /metrics. I'm using HelmChart 5.0.1 (version 4.0.0 of the image). I only changed the version in my helm install call.

Do you have any idea on what can happen ?

ardole avatar Oct 24 '24 14:10 ardole

It got "breaking" changes, that's why it's a new major version. The config to enable the webhook have been changed from collector.workflows to collector.workflow_runs. It's related to https://github.com/promhippie/github_exporter/releases/tag/v4.0.0 -> "Change https://github.com/promhippie/github_exporter/pull/412: Change config and metric names for workflows"

tboerger avatar Oct 24 '24 17:10 tboerger

Just to clarify the issue you are facing, the exporter got a default for unknown routes to redirect to the metrics endpoint. The webhook endpoint is enabled only if GITHUB_EXPORTER_COLLECTOR_WORKFLOW_RUNS or GITHUB_EXPORTER_COLLECTOR_WORKFLOW_JOBS have been enabled.

tboerger avatar Oct 24 '24 17:10 tboerger

Oh okay i see... so i had to update my values ;) Everythink is ok now, thank you

ardole avatar Oct 25 '24 07:10 ardole