newrelic-experimental / gitlab

Gitlab exporters to send metrics,logs,traces to New Relic
9 stars 6 forks source link

Unexpected keyword argument 'obey_rate_limit' #8

Closed ashwilson closed 1 year ago

ashwilson commented 1 year ago

Testing in docker, it fails from the pipeline and in standalone mode. We are using the self-hosted Omnibus Gitlab version, 15.8.2.

The env vars are all set, but it doesn't seem to ever use the token either.

docker run -it -e GLAB_STANDALONE=True -e GLAB_EXPORT_PATHS='x' -e GLAB_EXPORT_PROJECTS_REGEX='.*' -e GLAB_TOKEN='' -e NEW_RELIC_API_KEY='' -e GLAB_ENDPOINT=https:// -e GLAB_LOW_DATA_MODE=True docker.io/dpacheconr/gitlab-metrics-exporter:1.0.2
...
Traceback (most recent call last):
  File "/app/main.py", line 3, in <module>
    from get_resources import grab_data
  File "/app/get_resources.py", line 16, in <module>
    var.init()  
  File "/app/global_variables.py", line 49, in init
    gl = gitlab.Gitlab(url=str(GLAB_ENDPOINT),private_token="{}".format(GLAB_TOKEN),obey_rate_limit=False)
  File "/usr/local/lib/python3.10/site-packages/gitlab/client.py", line 105, in __init__
    self._backend = _backend(**kwargs)
TypeError: RequestsBackend.__init__() got an unexpected keyword argument 'obey_rate_limit'
ashwilson commented 1 year ago

Seems to run with v1.0.0 of image, but error with 403 at the same point

2023-03-02 16:56:26,461 INFO [project_logger] [metrics-exporter.py:98] [trace_id=0 span_id=0 resource.service.name=] - Project: 751 data
Log events sent for project : 751
...
gitlab.exceptions.GitlabHttpError: 403: 403 Forbidden

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/metrics-exporter.py", line 335, in <module>
    send_to_nr()
  File "/app/metrics-exporter.py", line 113, in send_to_nr
    environments = current_project.environments.list(get_all=True, sort='desc')
dpacheconr commented 1 year ago

obey_rate_limit was removed in 1.0.1, have you tried that?