-
Notifications
You must be signed in to change notification settings - Fork 244
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
Date filters not working in Grafana/Prometheus with gitlab-ci-pipeline-exporter #863
Comments
Hello, @mguassone-enginium This fix help me with column "Data" in dashbord: - "expr": "-max(time() - gitlab_ci_pipeline_timestamp{project=~\"$PROJECT\", ref=~\"$REF\"}) by (project, ref, kind) unless max(gitlab_ci_pipeline_status{status!~\"success\", project=~\"$PROJECT\", ref=~\"$REF\"}) by (project, ref, kind) > 0",
+ "expr": "-min(time() - gitlab_ci_pipeline_timestamp{project=~\"$PROJECT\", ref=~\"$REF\"}) by (project, ref, kind) unless max(gitlab_ci_pipeline_status{status!~\"success\", project=~\"$PROJECT\", ref=~\"$REF\"}) by (project, ref, kind) > 0", I changed it in Grafana GUI (B is the "Date" column). I think it's an original mistake in dashbord. |
1 - About your wish:
I think gitlab-ci-pipelines-exporter unfortunately don't suposed to do this.
2 - And problem with date range:
I also dissatisfied about this behavior, but I think gitlab-ci-pipelines-exporter just not for this, just only for recent pipelines. |
I came here with a similar mission: Make the duration of single jobs visible. Like have a historic time chart for the job duration of a specific test suite. However, after digging and reading docs, (especially helpful was this paragraph on timestamps ), I think prometheus isn't made for this at all. It always expects values to be available to scrape at its convencience. There is simply no support for historic data, which, in case of gitlab job runs, would have a lot of holes in them because they don't run permanently. |
As mentioned above, Prometheus is not initially designed for storing/processing/analyzing long-term data. This behavior of the GitLab exporter confused me at first too, but I believe it is correct behavior. It is assumed to be a metric collection service that operates continuously and collects short-term data in real time, in which case the timestamps will slightly differ from the pipeline and job timestamps themselves. However, if you need to scrape GitLab data for the past year and analyze it, you would need to manually adjust the dashboards. One way to resolve this is:
For example, here’s how one of the panel queries would change.
Here we use Grafana variables for the selected time range and filter based on it. With a deeper knowledge of PromQL, you can rewrite and optimize the queries from scratch yourself. |
I'm encountering an issue with date filters in Grafana when using the gitlab-ci-pipeline-exporter. It appears that the filters are not applying correctly to the exported data, and all time series are being displayed as if they occurred today (I think because I started today the gitlab-cipipeline-exporter container), even when filtering for specific dates in the past.
This behavior persists even when attempting to filter directly through Prometheus, suggesting that the issue might lie within the exporter itself or its interaction with Prometheus.
The inability to effectively filter data by date significantly hinders my ability to analyze historical pipeline trends and identify patterns over time.
Observed behavior
N.B.
Note that the date of the pipeline execution (or other pipeline details) is shown correctly, it is the filter on the timeseries that seems to refer to the date with which the exporter exported the data.
Expected behavior
Impact
Possible solutions
Additional questions
Has anyone else encountered similar issues with date filters and the gitlab-ci-pipeline-exporter?
Are there any known workarounds or community-supported solutions for addressing this filtering problem?
Thank you for your attention to this matter. I appreciate your assistance in resolving this issue and ensuring the accurate handling of date filters in Grafana with the gitlab-ci-pipeline-exporter.
Please let me know if you have any other questions or require further clarification.
Additional Context
docker-compose.yml
gitlab-ci-pipelines-exporter.yml
prometheus/config.yml
grafana/dashboards/dashboard_pipelines.json
grafana/datasources.yml
The text was updated successfully, but these errors were encountered: