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

Requests are sent to the server even they are disabled in the configuration #159

Open
LaurentMarchelli opened this issue Oct 19, 2023 · 0 comments
Labels
bug Something isn't working investigation

Comments

@LaurentMarchelli
Copy link
Contributor

  • Version : 0.30.0-386
  • Image : ghcr.io/liatrio/liatrio-otel-collector:0.30.0-386
  • Tests is realized with an authentication token with limited capacity (read only).
  • All Metrics except git.repository.count are disabled.

config.yaml

...
        scrapers:
          github:
            # https://github.com/open-telemetry/opentelemetry-collector/blob/main/receiver/README.md
            # https://github.com/open-telemetry/opentelemetry-collector/tree/main/config/confighttp
            # https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configtls/README.md
            github_org: "target_organization"
            endpoint: "https://ghetest.mycompany.grp:443/api"
            tls:
              insecure: false
              insecure_skip_verify: true
            auth:
              authenticator: "bearertokenauth/github"
            metrics:
              git.repository.branch.commit.aheadby.count:
                enabled: false
              git.repository.branch.commit.behindby.count:
                enabled: false
              git.repository.branch.count:
                enabled: false
              git.repository.branch.line.addition.count:
                enabled: false
              git.repository.branch.line.deletion.count:
                enabled: false
              git.repository.branch.time:
                enabled: false
              git.repository.count:
                enabled: true
              git.repository.pull_request.approval.time:
                enabled: false
              git.repository.pull_request.deployment.time:
                enabled: false
              git.repository.pull_request.merge.time:
                enabled: false
              git.repository.pull_request.merged.count:
                enabled: false
              git.repository.pull_request.open.count:
                enabled: false
              git.repository.pull_request.time:
                enabled: false
              # Optional Metrics
              git.repository.contributor.count:
                enabled: false
...

Log output :

2023-10-19T14:21:36.740Z error githubscraper/github_scraper.go:261 error getting branch data%!(EXTRA zapcore.Field={error 26 0  input:9: Your token has not been granted the required scopes to execute this query. The 'aheadBy' field requires one of the following scopes: ['repo'], but your token has only been granted the: ['public_repo', 'read:audit_log', 'read:org', 'read:project', 'read:public_key', 'read:repo_hook', 'read:user', 'repo:status', 'repo_deployment', 'user:email'] scopes. Please modify your token's scopes at: https://ghetest.mycompany.grp/settings/tokens.
input:10: Your token has not been granted the required scopes to execute this query. The 'behindBy' field requires one of the following scopes: ['repo'], but your token has only been granted the: ['public_repo', 'read:audit_log', 'read:org', 'read:project', 'read:public_key', 'read:repo_hook', 'read:user', 'repo:status', 'repo_deployment', 'user:email'] scopes. Please modify your token's scopes at: https://ghetest.mycompany.grp/settings/tokens.
}) {"kind": "receiver", "name": "gitprovider/build-tools", "data_type": "metrics"}
github.com/liatrio/liatrio-otel-collector/pkg/receiver/gitproviderreceiver/internal/scraper/githubscraper.(*githubScraper).getBranches
 /home/runner/work/liatrio-otel-collector/liatrio-otel-collector/pkg/receiver/gitproviderreceiver/internal/scraper/githubscraper/github_scraper.go:261
2023-10-19T14:21:36.790Z error githubscraper/github_scraper.go:261 error getting branch data%!(EXTRA zapcore.Field={error 26 0  input:9: Your token has not been granted the required scopes to execute this query. The 'aheadBy' field requires one of the following scopes: ['repo'], but your token has only been granted the: ['public_repo', 'read:audit_log', 'read:org', 'read:project', 'read:public_key', 'read:repo_hook', 'read:user', 'repo:status', 'repo_deployment', 'user:email'] scopes. Please modify your token's scopes at: https://ghetest.mycompany.grp/settings/tokens.
input:10: Your token has not been granted the required scopes to execute this query. The 'behindBy' field requires one of the following scopes: ['repo'], but your token has only been granted the: ['public_repo', 'read:audit_log', 'read:org', 'read:project', 'read:public_key', 'read:repo_hook', 'read:user', 'repo:status', 'repo_deployment', 'user:email'] scopes. Please modify your token's scopes at: https://ghetest.mycompany.grp/settings/tokens.
}) {"kind": "receiver", "name": "gitprovider/build-tools", "data_type": "metrics"}
github.com/liatrio/liatrio-otel-collector/pkg/receiver/gitproviderreceiver/internal/scraper/githubscraper.(*githubScraper).getBranches
 /home/runner/work/liatrio-otel-collector/liatrio-otel-collector/pkg/receiver/gitproviderreceiver/internal/scraper/githubscraper/github_scraper.go:261
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working investigation
Projects
None yet
Development

No branches or pull requests

3 participants