{"id":22325541,"url":"https://github.com/jamf/gitlab_license_exporter","last_synced_at":"2025-07-29T16:33:19.634Z","repository":{"id":51363375,"uuid":"272711192","full_name":"jamf/gitlab_license_exporter","owner":"jamf","description":"Gitlab License Information exporter","archived":true,"fork":false,"pushed_at":"2023-06-27T17:57:52.000Z","size":17,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"prod","last_synced_at":"2025-04-04T17:50:27.436Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-16T13:09:57.000Z","updated_at":"2024-01-04T13:48:01.000Z","dependencies_parsed_at":"2022-09-25T20:07:10.456Z","dependency_job_id":null,"html_url":"https://github.com/jamf/gitlab_license_exporter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jamf/gitlab_license_exporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamf%2Fgitlab_license_exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamf%2Fgitlab_license_exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamf%2Fgitlab_license_exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamf%2Fgitlab_license_exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamf","download_url":"https://codeload.github.com/jamf/gitlab_license_exporter/tar.gz/refs/heads/prod","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamf%2Fgitlab_license_exporter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267718282,"owners_count":24133448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-04T02:12:32.127Z","updated_at":"2025-07-29T16:33:19.293Z","avatar_url":"https://github.com/jamf.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://jenkins.public.jamf.build/buildStatus/icon?job=Devops%2FBuild+Infrastructure%2FGitlab%2Fgitlab-exporter-github%2Fmaster)](https://jenkins.jamf.build/job/Devops/job/Build%20Infrastructure/job/Gitlab/job/gitlab-exporter-github/job/master/)\n\n# Gitlab license exporter\nExposes License expiration date and active users from the Gitlab API, to a Prometheus compatible endpoint.\n\n## Configuration\nThis exporter is setup to take input from environment variables:\n\n### Required\n* `TOKEN`: Admin token\n\n### Optional\n* `URL`: Gitlab url example: `https://gitlab.domain.com` (by default will use k8s service `gitlab-web`)\n\n## Build and run\n### Manually\n```\ngo get\ngo build gitlabgoexporter.go\nexport TOKEN=token123token\nexport URL=https://gitlab.domain.com\n./gitlabgoexporter.go\n```\nVisit http://localhost:2222\n\n\n### Docker\nBuild a docker image:\n`docker build -t \u003cimage-name\u003e .`\n\nRun:\n* Custom URL:\n\t`docker image --env TOKEN=token123token --env URL=https://gitlab.domain.com \u003cimage-name\u003e`\n\n* Kubernetes Gitlab-Web service:\n\t`docker image --env TOKEN=token123token \u003cimage-name\u003e`\n\n\n### Kubernetes\n```\napiVersion: v1\nkind: Secret\nmetadata:\n  name: gitlab-token\n  namespace: {{ NAMESPACE }}\n  labels:\n    app: gitlab-exporter\ntype: Opaque\ndata:\n  token: {{ TOKEN | b64encode }}\n---\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: gitlab-exporter\n  namespace: {{ NAMESPACE }}\n  labels:\n    app: gitlab-exporter\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      app: gitlab-exporter\n  template:\n    metadata:\n      labels:\n        app: gitlab-exporter\n    spec:\n      containers:\n      - name: gitlab-exporter\n        image: {{{ image-name }}}\n        ports:\n        - containerPort: 2222\n        env:\n        - name: TOKEN\n          valueFrom:\n            secretKeyRef:\n              name: gitlab-token\n              key: token\n        resources:\n          limits:\n            cpu: 100m\n            memory: 128Mi\n          requests:\n            cpu: 50m\n            memory: 64Mi\n---\napiVersion: v1\nkind: Service\nmetadata:\n  name: gitlab-exporter-svc\n  namespace: {{ NAMESPACE }}\n  labels:\n    app: gitlab-exporter\nspec:\n  selector: \n    app: gitlab-exporter\n  ports:\n    - name: metrics\n      port: 8080\n      targetPort: 2222\n---\napiVersion: monitoring.coreos.com/v1\nkind: ServiceMonitor\nmetadata:\n  name: gitlab-export-metrics\n  namespace: {{ NAMESPACE }}\nspec:\n  selector:\n    matchLabels:\n      app: gitlab-exporter\n  endpoints:\n  - port: metrics\n    path: /\n    interval: 30s\n```\n\n## Metrics\nMetrics will be available on port 2222 by default\n\n## Collectors\n```\n# HELP gitlab_active_users Gitlab active users\n# HELP gitlab_license_expires_at Gitlab expiration day\n# HELP gitlab_scrape_success Gitlab go exporter scrape status when try to read the API\n# HELP gitlab_user_limit Users allowed by license\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamf%2Fgitlab_license_exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamf%2Fgitlab_license_exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamf%2Fgitlab_license_exporter/lists"}