projects/guix·blob python-team · refs

1055 lines · 42.6 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2018 Pierre Neidhardt <[email protected]>
3;;; Copyright © 2018 Tobias Geerinckx-Rice <[email protected]>
4;;; Copyright © 2018, 2019, 2020 Leo Famulari <[email protected]>
5;;; Copyright © 2020 Efraim Flashner <[email protected]>
6;;; Copyright © 2021 Sarah Morgensen <[email protected]>
7;;; Copyright © 2024 Dominic Martinez <[email protected]>
8;;; Copyright © 2024 Jesse Eisses <[email protected]>
9;;; Copyright © 2024 Sharlatan Hellseher <[email protected]>
10;;; Copyright © 2024 Troy Figiel <[email protected]>
11;;;
12;;; This file is part of GNU Guix.
13;;;
14;;; GNU Guix is free software; you can redistribute it and/or modify it
15;;; under the terms of the GNU General Public License as published by
16;;; the Free Software Foundation; either version 3 of the License, or (at
17;;; your option) any later version.
18;;;
19;;; GNU Guix is distributed in the hope that it will be useful, but
20;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22;;; GNU General Public License for more details.
23;;;
24;;; You should have received a copy of the GNU General Public License
25;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26
27;;; Commentary:
28;;;
29;;; Libraries and commands related to, or provided by Prometheus project
30;;; <https://prometheus.io>.
31;;;
32;;; Please: Try to add new module packages in alphabetic order.
33;;;
34;;; Code:
35
36(define-module (gnu packages prometheus)
37 #:use-module ((guix licenses) #:prefix license:)
38 #:use-module (guix build-system go)
39 #:use-module (guix gexp)
40 #:use-module (guix git-download)
41 #:use-module (guix packages)
42 #:use-module (guix utils)
43 #:use-module (gnu packages)
44 #:use-module (gnu packages golang)
45 #:use-module (gnu packages golang-build)
46 #:use-module (gnu packages golang-check)
47 #:use-module (gnu packages golang-compression)
48 #:use-module (gnu packages golang-crypto)
49 #:use-module (gnu packages golang-web)
50 #:use-module (gnu packages golang-xyz))
51
52
53;;;
54;;; Libraries:
55;;;
56
57(define-public go-contrib-go-opencensus-io-exporter-prometheus
58 (package
59 (name "go-contrib-go-opencensus-io-exporter-prometheus")
60 (version "0.4.2")
61 (source
62 (origin
63 (method git-fetch)
64 (uri (git-reference
65 (url
66 "https://github.com/census-ecosystem/opencensus-go-exporter-prometheus")
67 (commit (string-append "v" version))))
68 (file-name (git-file-name name version))
69 (sha256
70 (base32 "0n09d2nbng4bws9vi2ddq2ffv9hr0c3i9mif6fkjr4chyyyiy8ik"))))
71 (build-system go-build-system)
72 (arguments
73 (list
74 #:import-path "contrib.go.opencensus.io/exporter/prometheus"))
75 (propagated-inputs
76 (list go-github-com-google-go-cmp
77 go-github-com-prometheus-client-golang
78 go-github-com-prometheus-statsd-exporter
79 go-go-opencensus-io))
80 (home-page "https://github.com/census-ecosystem/opencensus-go-exporter-prometheus")
81 (synopsis "OpenCensus Go Prometheus Exporter")
82 (description
83 "Package prometheus contains a Prometheus exporter that supports
84exporting @code{OpenCensus} views as Prometheus metrics.")
85 (license license:asl2.0)))
86
87(define-public go-github-com-grpc-ecosystem-go-grpc-prometheus
88 (package
89 (name "go-github-com-grpc-ecosystem-go-grpc-prometheus")
90 (version "1.2.0")
91 (source
92 (origin
93 (method git-fetch)
94 (uri (git-reference
95 (url "https://github.com/grpc-ecosystem/go-grpc-prometheus")
96 (commit (string-append "v" version))))
97 (file-name (git-file-name name version))
98 (sha256
99 (base32 "1lzk54h7np32b3acidg1ggbn8ppbnns0m71gcg9d1qkkdh8zrijl"))))
100 (build-system go-build-system)
101 (arguments
102 (list
103 ;; Source only package, [email protected] still needs
104 ;; it while the project is archived. Remove when no longer required.
105 #:skip-build? #t
106 #:tests? #f
107 #:import-path "github.com/grpc-ecosystem/go-grpc-prometheus"))
108 (propagated-inputs
109 (list go-github-com-prometheus-client-golang
110 go-golang-org-x-net
111 go-google-golang-org-grpc))
112 (home-page "https://github.com/grpc-ecosystem/go-grpc-prometheus")
113 (synopsis "Go gRPC Interceptors for Prometheus monitoring")
114 (description
115 "This package implements a Prometheus monitoring for your
116@url{https://github.com/grpc/grpc-go, gRPC Go} servers and clients.")
117 (license license:asl2.0)))
118
119(define-public go-github-com-mwitkow-go-conntrack
120 (package
121 (name "go-github-com-mwitkow-go-conntrack")
122 (version "0.0.0-20190716064945-2f068394615f")
123 (source
124 (origin
125 (method git-fetch)
126 (uri (git-reference
127 (url "https://github.com/mwitkow/go-conntrack")
128 (commit (go-version->git-ref version))))
129 (file-name (git-file-name name version))
130 (sha256
131 (base32 "0ymjmy12ks7smgwmrwsa5kf07d9w5kpk1dn650azlzr61b561aw7"))))
132 (build-system go-build-system)
133 (arguments
134 (list
135 #:tests? #f
136 #:import-path "github.com/mwitkow/go-conntrack"
137 #:phases
138 #~(modify-phases %standard-phases
139 ;; Breaking cycle:
140 ;; go-github-com-prometheus-common ->
141 ;; go-github-com-prometheus-client-golang ->
142 ;; go-github-com-mwitkow-go-conntrack ->
143 ;; go-github-com-prometheus-common
144 (delete 'build))))
145 (native-inputs
146 (list go-github-com-stretchr-testify))
147 (propagated-inputs
148 (list go-github-com-jpillora-backoff
149 go-github-com-munnerz-goautoneg
150 ;; go-github-com-prometheus-client-golang
151 go-golang-org-x-net))
152 (home-page "https://github.com/mwitkow/go-conntrack")
153 (synopsis "Go middleware for @code{net.Conn} tracking")
154 (description
155 "@url{https://prometheus.io/,Prometheus} monitoring and
156@url{https://godoc.org/golang.org/x/net/trace#@code{EventLog,(code}
157x/net/trace)} tracing wrappers @code{net.Conn}, both inbound
158(@@code{net.Listener}) and outbound (@@code{net.Dialer}).")
159 (license license:asl2.0)))
160
161(define-public go-github-com-nbrownus-go-metrics-prometheus
162 (package
163 (name "go-github-com-nbrownus-go-metrics-prometheus")
164 (version "0.0.0-20210712211119-974a6260965f")
165 (source
166 (origin
167 (method git-fetch)
168 (uri (git-reference
169 (url "https://github.com/nbrownus/go-metrics-prometheus")
170 (commit (go-version->git-ref version))))
171 (file-name (git-file-name name version))
172 (sha256
173 (base32 "1kl9l08aas544627zmhkgp843qx94sxs4inxm20nw1hx7gp79dz0"))))
174 (build-system go-build-system)
175 (arguments
176 (list
177 ;; The project looks abandoned, tests failed with a new go-metrics, see
178 ;; <https://github.com/nbrownus/go-metrics-prometheus/pull/2>.
179 #:tests? #f
180 #:import-path "github.com/nbrownus/go-metrics-prometheus"))
181 (native-inputs
182 (list go-github-com-stretchr-testify))
183 (propagated-inputs
184 (list go-github-com-prometheus-client-golang
185 go-github-com-rcrowley-go-metrics))
186 (home-page "https://github.com/nbrownus/go-metrics-prometheus")
187 (synopsis "Prometheus support for go-metrics")
188 (description
189 "This package provides a reporter for the @code{go-metrics} library which
190posts the metrics to the Prometheus client registry and just updates the
191registry.")
192 (license license:asl2.0)))
193
194(define-public go-github-com-prometheus-alertmanager
195 (package
196 (name "go-github-com-prometheus-alertmanager")
197 (version "0.31.1") ;XXX: newer versions depend on buf
198 (source
199 (origin
200 (method git-fetch)
201 (uri (git-reference
202 (url "https://github.com/prometheus/alertmanager")
203 (commit (string-append "v" version))))
204 (file-name (git-file-name name version))
205 (sha256
206 (base32 "0r791bcj8sbxfjwiwwxik27q57lb19018p1zlbaczg3ljrp3chqy"))))
207 (build-system go-build-system)
208 (arguments
209 (list
210 #:skip-build? #t
211 #:import-path "github.com/prometheus/alertmanager"
212 #:unpack-path "github.com/prometheus/alertmanager"
213 #:embed-files #~(list ".*\\.css" ".*\\.html" ".*\\.json")
214 #:test-flags
215 #~(list "-skip" (string-join
216 ;; Tests expecting alertmanager binary.
217 (list "TestAddAlerts"
218 "TestAddSilence"
219 "TestAddUTF8Alerts"
220 "TestAddUTF8Silences"
221 "TestAlertGetReturnsCurrentAlertStatus"
222 "TestAlwaysInhibiting"
223 "TestBatching"
224 "TestCannotAddUTF8AlertsInClassicMode"
225 "TestCannotAddUTF8SilencesInClassicMode"
226 "TestClusterDeduplication"
227 "TestClusterVSInstance"
228 "TestColdStart"
229 "TestEmailRejected"
230 "TestEmptyInhibitionRule"
231 "TestFilterAlertRequest"
232 "TestFinalAdvertiseAddr"
233 "TestInhibiting"
234 "TestInstallingNewTracerProvider"
235 "TestMergeAlerts"
236 "TestMergeAlertsWithEndsAt"
237 "TestReinstallingTracerProvider"
238 "TestReinstallingTracerProviderWithTLS"
239 "TestReload"
240 "TestRepeat"
241 "TestResolved"
242 "TestResolvedFilter"
243 "TestRetry"
244 "TestSendAlertsToUTF8Route"
245 "TestSilenceDelete"
246 "TestSilencing"
247 "TestTracerProviderShutdown"
248 "TestUninstallingTracerProvider"
249 "TestWebWithPrefix"
250 "TestWebhookTimeout")
251 "|"))
252 #:phases
253 #~(modify-phases %standard-phases
254 (add-after 'unpack 'remove-broken-tests
255 (lambda* (#:key tests? unpack-path #:allow-other-keys)
256 (with-directory-excursion (string-append "src/" unpack-path)
257 ;; panic: unable to access amtool binary: error accessing
258 ;; amtool command, try 'make build' to generate the file. stat
259 ;; ../../../amtool: no such file or directory
260 (delete-file "test/cli/acceptance/cli_test.go"))))
261 (add-after 'unpack 'remove-examples
262 (lambda* (#:key tests? unpack-path #:allow-other-keys)
263 (with-directory-excursion (string-append "src/" unpack-path)
264 (delete-file-recursively "examples")))))))
265 (native-inputs
266 (list go-github-com-emersion-go-smtp
267 go-github-com-kylelemons-godebug
268 go-github-com-stretchr-testify))
269 (propagated-inputs
270 (list go-github-com-kimmachinegun-automemlimit
271 go-github-com-alecthomas-kingpin-v2
272 go-github-com-alecthomas-units
273 go-github-com-aws-aws-sdk-go-v2
274 go-github-com-aws-aws-sdk-go-v2-config
275 go-github-com-aws-aws-sdk-go-v2-credentials
276 go-github-com-aws-aws-sdk-go-v2-service-sns
277 go-github-com-aws-aws-sdk-go-v2-service-sts
278 go-github-com-aws-smithy-go
279 go-github-com-cenkalti-backoff-v4
280 go-github-com-cespare-xxhash-v2
281 go-github-com-coder-quartz
282 go-github-com-go-openapi-analysis
283 go-github-com-go-openapi-errors
284 go-github-com-go-openapi-loads
285 go-github-com-go-openapi-runtime
286 go-github-com-go-openapi-spec
287 go-github-com-go-openapi-strfmt
288 go-github-com-go-openapi-swag
289 go-github-com-go-openapi-validate
290 go-github-com-gogo-protobuf
291 go-github-com-google-uuid
292 go-github-com-hashicorp-go-sockaddr
293 go-github-com-hashicorp-golang-lru-v2
294 go-github-com-hashicorp-memberlist
295 go-github-com-jessevdk-go-flags
296 go-github-com-matttproud-golang-protobuf-extensions
297 go-github-com-oklog-run
298 go-github-com-oklog-ulid-v2
299 go-github-com-prometheus-client-golang
300 go-github-com-prometheus-common
301 go-github-com-prometheus-exporter-toolkit
302 go-github-com-prometheus-sigv4
303 go-github-com-rs-cors
304 go-github-com-shurcool-httpfs
305 go-github-com-shurcool-vfsgen
306 go-github-com-xlab-treeprint
307 go-go-opentelemetry-io-contrib-instrumentation-net-http-httptrace-otelhttptrace
308 go-go-opentelemetry-io-contrib-instrumentation-net-http-otelhttp
309 go-go-opentelemetry-io-otel
310 go-go-opentelemetry-io-otel-exporters-otlp-otlptrace
311 go-go-opentelemetry-io-otel-exporters-otlp-otlptrace-otlptracegrpc
312 go-go-opentelemetry-io-otel-exporters-otlp-otlptrace-otlptracehttp
313 go-go-opentelemetry-io-otel-sdk
314 go-go-opentelemetry-io-otel-trace
315 go-go-uber-org-automaxprocs
316 go-golang-org-x-mod
317 go-golang-org-x-net
318 go-golang-org-x-text
319 go-golang-org-x-tools
320 go-google-golang-org-grpc
321 go-gopkg-in-telebot-v3
322 go-gopkg-in-yaml-v2))
323 (home-page "https://github.com/prometheus/alertmanager")
324 (synopsis "Prometheus Alertmanager")
325 (description
326 "The Alertmanager handles alerts sent by client applications such as the
327Prometheus server. It takes care of deduplicating, grouping, and routing them
328to the correct
329@url{https://prometheus.io/docs/alerting/latest/configuration/#receiver,
330receiver integrations} such as email, @code{PagerDuty}, @code{OpsGenie}, or
331many other
332@url{https://prometheus.io/docs/operating/integrations/#alertmanager-webhook-receiver,
333mechanisms} thanks to the webhook receiver. It also takes care of silencing
334and inhibition of alerts.")
335 (license license:asl2.0)))
336
337(define-public go-github-com-prometheus-client-golang
338 (package
339 (name "go-github-com-prometheus-client-golang")
340 (version "1.23.2")
341 (source
342 (origin
343 (method git-fetch)
344 (uri (git-reference
345 (url "https://github.com/prometheus/client_golang")
346 (commit (string-append "v" version))))
347 (file-name (git-file-name name version))
348 (sha256
349 (base32 "054hdlyjkyna1xx39apl7srzvjsyirnn1ihbaqarxbygdrz3zrx1"))))
350 (build-system go-build-system)
351 (arguments
352 (list
353 #:go go-1.24
354 #:skip-build? #t
355 ;; XXX: Check if the most of the tests may be enabled:
356 ;; api/prometheus/v1/api_test.go:1063:23: cannot use 1634644800304
357 ;; (untyped int constant) as int value in map literal (overflows)
358 #:tests? (target-64bit?)
359 #:import-path "github.com/prometheus/client_golang"
360 #:test-flags
361 #~(list "-skip"
362 (string-join
363 (list
364 ;; go_collector_latest_test.go:131: found unexpected metric
365 ;; go_godebug_non_default_behavior_httpcookiemaxnum_events_total
366 "TestGoCollector_ExposedMetrics"
367 ;; Tests fail with message: found new runtime/metrics
368 ;; metric
369 ;; /godebug/non-default-behavior/httpcookiemaxnum:events
370 ;; a new Go version may have been detected, please run go
371 ;; run gen_go_collector_metrics_set.go go1.X where X is
372 ;; the Go version you are currently using
373 "TestExpectedRuntimeMetrics"
374 ;; Assertions are not equal to compare strings.
375 "TestGoCollectorAllowList/allow_all"
376 "TestGoCollectorAllowList/allow_debug"
377 ;; Test fails on aarch64-linux system.
378 #$@(if (not (target-x86-64?))
379 '("TestProcessCollector")
380 '()))
381 "|"))
382 #:phases
383 #~(modify-phases %standard-phases
384 (add-after 'unpack 'remove-examples-and-tutorials
385 (lambda* (#:key import-path #:allow-other-keys)
386 (with-directory-excursion (string-append "src/" import-path)
387 (for-each delete-file-recursively
388 (list "api/prometheus/v1/example_test.go"
389 "examples"
390 "tutorials"))))))))
391 (native-inputs
392 (list go-github-com-google-go-cmp
393 go-go-uber-org-goleak))
394 (propagated-inputs
395 (list go-github-com-beorn7-perks
396 go-github-com-cespare-xxhash-v2
397 go-github-com-json-iterator-go
398 go-github-com-klauspost-compress
399 go-github-com-kylelemons-godebug
400 go-github-com-prometheus-client-model
401 go-github-com-prometheus-common
402 go-github-com-prometheus-procfs
403 go-golang-org-x-sys
404 go-google-golang-org-protobuf))
405 (home-page "https://github.com/prometheus/client_golang")
406 (synopsis "HTTP server and client tools for Prometheus")
407 (description
408 "This package @code{promhttp} provides HTTP client and server tools for
409Prometheus metrics.")
410 (license license:asl2.0)))
411
412(define-public go-github-com-prometheus-client-model
413 (package
414 (name "go-github-com-prometheus-client-model")
415 (version "0.6.2")
416 (source
417 (origin
418 (method git-fetch)
419 (uri (git-reference
420 (url "https://github.com/prometheus/client_model")
421 (commit (string-append "v" version))))
422 (file-name (git-file-name name version))
423 (sha256
424 (base32 "1r0magjb44ckin8mrp6shihbl7lvsswfry4hr9yr6d12zzm638db"))))
425 (build-system go-build-system)
426 (arguments
427 (list
428 ;; TODO: Check if need/can generare *.go from proto files, see Makefile.
429 #:skip-build? #t
430 #:import-path "github.com/prometheus/client_model"))
431 (propagated-inputs
432 (list go-github-com-golang-protobuf))
433 (home-page "https://github.com/prometheus/client_model")
434 (synopsis "Data model artifacts for Prometheus")
435 (description
436 "This package provides data model artifacts for Prometheus.")
437 (license license:asl2.0)))
438
439(define-public go-github-com-prometheus-common
440 (package
441 (name "go-github-com-prometheus-common")
442 (version "0.67.5")
443 (source
444 (origin
445 (method git-fetch)
446 (uri (git-reference
447 (url "https://github.com/prometheus/common")
448 (commit (string-append "v" version))))
449 (file-name (git-file-name name version))
450 (sha256
451 (base32 "0bkv73aq8ryaybvya1x5i2gvl5iffiysw5viagcrvak7ffrb09wp"))
452 (modules '((guix build utils)))
453 (snippet
454 #~(begin
455 ;; Submodules with their own go.mod files and packed as
456 ;; separated packages:
457 ;;
458 ;; - github.com/prometheus/common/assets
459 (delete-file-recursively "assets")))))
460 (build-system go-build-system)
461 (arguments
462 (list
463 #:skip-build? #t
464 #:import-path "github.com/prometheus/common"
465 #:test-subdirs
466 #~(list
467 ;; Skip, as it requires
468 ;; <github.com/prometheus/client_golang/prometheus>, which introduces
469 ;; cycle.
470 ;; "./config/..."
471
472 ;; Some tests fail on non x86_64 architecture: Cannot use 9223372036
473 ;; (untyped int constant) as int value in ;; struct literal
474 ;; (overflows). Cannot use math.MaxInt64 (untyped int constant
475 ;; 9223372036854775807) as int value in argument to HumanizeTimestamp
476 ;; (overflows)
477 #$@(if (target-x86-64?)
478 '("./helpers/...")
479 '())
480 "./expfmt/..."
481 "./model/..."
482 "./promlog/..."
483 "./route/..."
484 "./server/...")))
485 (native-inputs
486 (list go-github-com-google-go-cmp
487 go-github-com-stretchr-testify))
488 (propagated-inputs
489 (list go-github-com-alecthomas-kingpin-v2
490 go-github-com-golang-jwt-jwt-v5
491 go-github-com-google-uuid
492 go-github-com-julienschmidt-httprouter
493 go-github-com-munnerz-goautoneg
494 go-github-com-mwitkow-go-conntrack
495 go-github-com-prometheus-client-model
496 go-go-yaml-in-yaml-v2
497 go-golang-org-x-net
498 go-golang-org-x-oauth2
499 go-google-golang-org-protobuf))
500 (home-page "https://github.com/prometheus/common")
501 (synopsis "Shared Prometheus Golang components")
502 (description
503 "This package provides Go libraries that are shared across Prometheus
504components.
505
506@itemize
507@item @code{config} - common configuration structures
508@item @code{expfmt} - decoding and encoding for the exposition format
509@item @code{model} - shared data structures
510@item @code{promslog} - a logging wrapper around log/slog
511@item @code{route} - a routing wrapper around httprouter using context.Context
512@item @code{server} - common servers
513@item @code{version} version information and metrics
514@end itemize")
515 (license license:asl2.0)))
516
517(define-public go-github-com-prometheus-common-assets
518 (package
519 (name "go-github-com-prometheus-common-assets")
520 (version "0.2.0")
521 (source
522 (origin
523 (method git-fetch)
524 (uri (git-reference
525 (url "https://github.com/prometheus/common")
526 (commit (go-version->git-ref version
527 #:subdir "assets"))))
528 (file-name (git-file-name name version))
529 (sha256
530 (base32 "0r7sym4yaysbkc5anyypl57v9ay0a1flq00j85j7lcficl2scwrs"))))
531 (build-system go-build-system)
532 (arguments
533 (list
534 #:import-path "github.com/prometheus/common/assets"
535 #:unpack-path "github.com/prometheus/common"))
536 (home-page "https://github.com/prometheus/common")
537 (synopsis "Prometheus assets")
538 (description
539 "This package provides Prometheus assets.")
540 (license license:asl2.0)))
541
542(define-public go-github-com-prometheus-community-pro-bing
543 (package
544 (name "go-github-com-prometheus-community-pro-bing")
545 (version "0.5.0")
546 (source
547 (origin
548 (method git-fetch)
549 (uri (git-reference
550 (url "https://github.com/prometheus-community/pro-bing")
551 (commit (string-append "v" version))))
552 (file-name (git-file-name name version))
553 (sha256
554 (base32 "19757nqz0cpq7ir2w5xgjxpblhmkpk0j7spfw4j68agavbx6hxpm"))))
555 (build-system go-build-system)
556 (arguments
557 (list
558 ;; Tests requiring network setup, and root access.
559 #:test-flags
560 #~(list "-skip"
561 (string-join
562 (list "TestNewPingerValid"
563 "TestSetIPAddr"
564 "TestSetInterfaceName"
565 "TestSetResolveTimeout")
566 "|"))
567 #:import-path "github.com/prometheus-community/pro-bing"))
568 (propagated-inputs
569 (list go-github-com-google-uuid
570 go-golang-org-x-net
571 go-golang-org-x-sync))
572 (home-page "https://github.com/prometheus-community/pro-bing")
573 (synopsis "Continuous probers Golang library")
574 (description
575 "This package implements @acronym{Internet Control Message
576Protocol,ICMP} echo (ping) functionality.")
577 (license license:expat)))
578
579(define-public go-github-com-prometheus-exporter-toolkit
580 (package
581 (name "go-github-com-prometheus-exporter-toolkit")
582 (version "0.13.2")
583 (source
584 (origin
585 (method git-fetch)
586 (uri (git-reference
587 (url "https://github.com/prometheus/exporter-toolkit")
588 (commit (string-append "v" version))))
589 (file-name (git-file-name name version))
590 (sha256
591 (base32 "05k4sfrc1zs96iprgnap0gd42vwfq47j6vg2bv83nckcv731gmiv"))))
592 (build-system go-build-system)
593 (arguments
594 (list
595 #:import-path "github.com/prometheus/exporter-toolkit"
596 #:phases
597 #~(modify-phases %standard-phases
598 ;; XXX: Workaround for go-build-system's lack of Go modules support.
599 (delete 'build)
600 (replace 'check
601 (lambda* (#:key tests? import-path #:allow-other-keys)
602 (when tests?
603 (with-directory-excursion (string-append "src/" import-path)
604 (invoke "go" "test" "-v"
605 "-skip" "TestServerBehaviour|TestConfigReloading"
606 "./..."))))))))
607 (native-inputs
608 (list go-google-golang-org-protobuf))
609 (propagated-inputs
610 (list go-github-com-alecthomas-kingpin-v2
611 go-github-com-coreos-go-systemd-v22
612 go-github-com-go-kit-log
613 go-github-com-mdlayher-vsock
614 ; Imported for go-github-com-prometheus-common to break the cycle.
615 go-github-com-prometheus-client-golang
616 go-github-com-prometheus-common
617 go-golang-org-x-crypto
618 go-golang-org-x-sync
619 go-gopkg-in-yaml-v2))
620 (home-page "https://github.com/prometheus/exporter-toolkit")
621 (synopsis "Utility package to build Prometheus exporters")
622 (description
623 "This package provides tooling to build Prometheus exporters")
624 (license license:asl2.0)))
625
626(define-public go-github-com-prometheus-otlptranslator
627 (package
628 (name "go-github-com-prometheus-otlptranslator")
629 (version "1.0.0")
630 (source
631 (origin
632 (method git-fetch)
633 (uri (git-reference
634 (url "https://github.com/prometheus/otlptranslator")
635 (commit (string-append "v" version))))
636 (file-name (git-file-name name version))
637 (sha256
638 (base32 "1naca6ima2bzf6yhb2w9favqx644c0q1y16jlb2na7s4bgr3107p"))))
639 (build-system go-build-system)
640 (arguments
641 (list
642 #:import-path "github.com/prometheus/otlptranslator"))
643 (home-page "https://github.com/prometheus/otlptranslator")
644 (synopsis "OTLP Prometheus Translator")
645 (description
646 "This package provides a functionality to convert
647@url{https://opentelemetry.io/docs/specs/otlp/, OTLP} metric and attribute
648names to @url{https://prometheus.io/, Prometheus-compliant} formats. This is
649an internal library for both Prometheus and Open Telemetry,")
650 (license license:asl2.0)))
651
652(define-public go-github-com-prometheus-procfs
653 (package
654 (name "go-github-com-prometheus-procfs")
655 (version "0.19.2")
656 (source
657 (origin
658 (method git-fetch)
659 (uri (git-reference
660 (url "https://github.com/prometheus/procfs")
661 (commit (string-append "v" version))))
662 (file-name (git-file-name name version))
663 (sha256
664 (base32 "1szpgj5w4bbrrjy7whpmaz0l05zkrzscg6nwkph8fajfq78aalvg"))))
665 (build-system go-build-system)
666 (arguments
667 (list
668 ;; XXX: Check if the most of the tests may be enabled on non x86_64
669 ;; architectures, disable for now: ./proc_stat_test.go:98:49: cannot use
670 ;; math.MinInt64 (untyped int constant -9223372036854775808) as int
671 ;; value in struct literal (overflows).
672 #:tests? (target-x86-64?)
673 #:import-path "github.com/prometheus/procfs"
674 #:phases
675 #~(modify-phases %standard-phases
676 (add-before 'check 'unpack-testdata
677 (lambda* (#:key tests? import-path #:allow-other-keys)
678 (with-directory-excursion (string-append "src/" import-path)
679 (invoke "./ttar" "-C" "testdata/" "-x" "-f" "testdata/fixtures.ttar"))))
680 (add-after 'check 'remove-testdata
681 (lambda* (#:key tests? import-path #:allow-other-keys)
682 (with-directory-excursion (string-append "src/" import-path)
683 (delete-file-recursively "testdata")))))))
684 (native-inputs
685 (list go-github-com-google-go-cmp))
686 (propagated-inputs
687 (list go-golang-org-x-sync
688 go-golang-org-x-sys))
689 (synopsis "Go library for reading @file{/proc}")
690 (home-page "https://github.com/prometheus/procfs")
691 (description
692 "The @code{procfs} Go package provides functions to retrieve system,
693kernel, and process metrics from the @file{/proc} pseudo file system.")
694 (license license:asl2.0)))
695
696(define-public go-github-com-prometheus-prometheus
697 (package
698 (name "go-github-com-prometheus-prometheus")
699 (version "0.308.0")
700 (source
701 (origin
702 (method git-fetch)
703 (uri (git-reference
704 (url "https://github.com/prometheus/prometheus")
705 (commit (string-append "v" version))))
706 (file-name (git-file-name name version))
707 (sha256
708 (base32 "1n9yl2mk9nz57g8k4jnwlqssfrky6ahkqk1fpx8bq36g0g3rj6w5"))
709 (modules '((guix build utils)))
710 (snippet
711 #~(begin
712 ;; Submodules with their own go.mod files and packaged separately.
713 (delete-file-recursively "documentation/examples/remote_storage")
714 (delete-file-recursively "web/ui/mantine-ui/src/promql/tools")))))
715 (build-system go-build-system)
716 (arguments
717 (list
718 #:skip-build? #t
719 #:import-path "github.com/prometheus/prometheus"
720 ;; XXX: Remove when all inputs are packaged.
721 #:test-subdirs
722 #~(list "schema" "template" "discovery" "tsdb/wlog" "util/pool"
723 "util/stats" "tsdb/chunks" "tsdb/errors" "tsdb/record"
724 "util/almost" "model/labels" "util/fmtutil" "util/logging"
725 "util/strutil" "discovery/aws" "discovery/dns" "discovery/xds"
726 "model/relabel" "model/rulefmt" "promql/parser" "tsdb/chunkenc"
727 "tsdb/fileutil" "tsdb/tsdbutil" "util/httputil" "util/junitxml"
728 "util/zeropool" "discovery/file" "discovery/http"
729 "discovery/moby" "tsdb/goversion" "discovery/uyuni"
730 "model/histogram" "model/textparse" "prompb/rwcommon"
731 "tsdb/tombstones" "discovery/eureka" "discovery/triton"
732 "util/compression" "util/convertnhcb" "discovery/hetzner"
733 "discovery/refresh" "util/netconnlimit" "discovery/marathon"
734 "discovery/puppetdb" "util/notifications" "discovery/kubernetes"
735 "discovery/targetgroup" "discovery/digitalocean"
736 "storage/remote/azuread" "util/namevalidationutil"
737 "prompb/io/prometheus/client" "prompb/io/prometheus/write/v2"
738 "documentation/examples/custom-sd/adapter")))
739 (native-inputs
740 ;; Tests and application dependency keep here.
741 (list go-github-com-google-go-cmp
742 go-github-com-google-pprof
743 go-github-com-kimmachinegun-automemlimit
744 go-github-com-oklog-run
745 go-github-com-stretchr-testify
746 go-go-uber-org-automaxprocs
747 go-go-uber-org-goleak
748 go-k8s-io-klog-v2
749 ;; go-github-com-nsf-jsondiff
750 #;go-k8s-io-klog))
751 (propagated-inputs
752 (list go-github-com-alecthomas-kingpin-v2
753 go-github-com-alecthomas-units
754 go-github-com-aws-aws-sdk-go-v2
755 go-github-com-aws-aws-sdk-go-v2
756 go-github-com-aws-aws-sdk-go-v2-config
757 go-github-com-aws-aws-sdk-go-v2-credentials
758 go-github-com-aws-aws-sdk-go-v2-feature-ec2-imds
759 go-github-com-aws-aws-sdk-go-v2-service-sts
760 go-github-com-aws-smithy-go
761 go-github-com-azure-azure-sdk-for-go-sdk-azcore
762 go-github-com-azure-azure-sdk-for-go-sdk-azidentity
763 go-github-com-cespare-xxhash-v2
764 go-github-com-code-hex-go-generics-cache
765 go-github-com-dennwc-varint
766 go-github-com-digitalocean-godo
767 go-github-com-docker-docker
768 go-github-com-edsrzf-mmap-go
769 go-github-com-envoyproxy-go-control-plane-envoy
770 go-github-com-envoyproxy-protoc-gen-validate
771 go-github-com-facette-natsort
772 go-github-com-fsnotify-fsnotify
773 go-github-com-go-openapi-strfmt
774 go-github-com-gogo-protobuf
775 go-github-com-golang-snappy
776 go-github-com-google-uuid
777 go-github-com-grafana-regexp
778 go-github-com-hetznercloud-hcloud-go-v2
779 go-github-com-json-iterator-go
780 go-github-com-klauspost-compress
781 go-github-com-kolo-xmlrpc
782 go-github-com-miekg-dns
783 go-github-com-munnerz-goautoneg
784 go-github-com-mwitkow-go-conntrack
785 go-github-com-oklog-ulid-v2
786 go-github-com-prometheus-alertmanager
787 go-github-com-prometheus-client-golang
788 go-github-com-prometheus-client-model
789 go-github-com-prometheus-common
790 go-github-com-prometheus-common-assets
791 go-github-com-prometheus-exporter-toolkit
792 go-github-com-prometheus-otlptranslator
793 go-github-com-prometheus-sigv4
794 go-github-com-shurcool-httpfs
795 go-go-opentelemetry-io-contrib-instrumentation-net-http-httptrace-otelhttptrace
796 go-go-opentelemetry-io-contrib-instrumentation-net-http-otelhttp
797 go-go-opentelemetry-io-otel
798 go-go-opentelemetry-io-otel-exporters-otlp-otlptrace
799 go-go-opentelemetry-io-otel-exporters-otlp-otlptrace-otlptracegrpc
800 go-go-opentelemetry-io-otel-exporters-otlp-otlptrace-otlptracehttp
801 go-go-opentelemetry-io-otel-metric
802 go-go-opentelemetry-io-otel-sdk
803 go-go-opentelemetry-io-otel-trace
804 go-go-uber-org-atomic
805 go-go-uber-org-multierr
806 go-go-yaml-in-yaml-v2
807 go-golang-org-x-oauth2
808 go-golang-org-x-sync
809 go-golang-org-x-sys
810 go-golang-org-x-text
811 go-google-golang-org-api
812 go-google-golang-org-genproto-googleapis-api
813 go-google-golang-org-grpc
814 go-google-golang-org-protobuf
815 go-gopkg-in-yaml-v3
816 go-k8s-io-api
817 go-k8s-io-apimachinery
818 go-k8s-io-client-go
819
820 ;; TODO: Complete packaging.
821 ;; go-github-com-aws-aws-sdk-go-v2-service-ec2
822 ;; go-github-com-aws-aws-sdk-go-v2-service-ecs
823 ;; go-github-com-aws-aws-sdk-go-v2-service-lightsail
824 ;; go-github-com-azure-azure-sdk-for-go-sdk-resourcemanager-compute-armcompute-v5
825 ;; go-github-com-azure-azure-sdk-for-go-sdk-resourcemanager-network-armnetwork-v4
826 ;; go-github-com-bboreham-go-loser
827 ;; go-github-com-go-zookeeper-zk
828 ;; go-github-com-gophercloud-gophercloud-v2
829 ;; go-github-com-hashicorp-consul-api
830 ;; go-github-com-hashicorp-nomad-api
831 ;; go-github-com-ionos-cloud-sdk-go-v6
832 ;; go-github-com-linode-linodego
833 ;; go-github-com-open-telemetry-opentelemetry-collector-contrib-processor-deltatocumulativeprocessor
834 ;; go-github-com-ovh-go-ovh
835 ;; go-github-com-prometheus-client-golang-exp
836 ;; go-github-com-scaleway-scaleway-sdk-go
837 ;; go-github-com-stackitcloud-stackit-sdk-go-core
838 ;; go-github-com-vultr-govultr-v2
839 ;; go-go-opentelemetry-io-collector-component
840 ;; go-go-opentelemetry-io-collector-consumer
841 ;; go-go-opentelemetry-io-collector-pdata
842 ;; go-go-opentelemetry-io-collector-processor
843 ;; go-go-opentelemetry-io-collector-semconv
844 #;go-k8s-io-klog))
845 (home-page "https://github.com/prometheus/prometheus")
846 (synopsis "Monitoring system and time series database")
847 (description
848 "This package, a Cloud Native Computing Foundation project, is a systems and
849service monitoring system. It collects metrics from configured targets at
850given intervals, evaluates rule expressions, displays the results, and can
851trigger alerts when specified conditions are observed.")
852 (license license:asl2.0)
853 ;; XXX: Don't expose since it's a partial package.
854 (properties '((hidden? . #t)))))
855
856(define-public go-github-com-prometheus-sigv4
857 (package
858 (name "go-github-com-prometheus-sigv4")
859 (version "0.1.2")
860 (source
861 (origin
862 (method git-fetch)
863 (uri (git-reference
864 (url "https://github.com/prometheus/sigv4")
865 (commit (string-append "v" version))))
866 (file-name (git-file-name name version))
867 (sha256
868 (base32 "0yw37lw4x2l20l02i6yd4m4x948vgrfyaa0csl155rdyq3ynwa5w"))))
869 (build-system go-build-system)
870 (arguments
871 (list
872 #:import-path "github.com/prometheus/sigv4"))
873 (native-inputs
874 (list go-github-com-stretchr-testify))
875 (propagated-inputs
876 (list go-github-com-aws-aws-sdk-go
877 go-github-com-prometheus-client-golang
878 go-github-com-prometheus-common
879 go-gopkg-in-yaml-v2))
880 (home-page "https://github.com/prometheus/sigv4")
881 (synopsis "HTTP signed requests with Amazon's Signature Verification V4")
882 (description
883 "sigv4 provides a @code{http.RoundTripper} that will sign requests using
884Amazon's Signature Verification V4 signing procedure, using credentials from
885the default AWS credential chain.")
886 (license license:asl2.0)))
887
888(define-public go-github-com-prometheus-statsd-exporter
889 (package
890 (name "go-github-com-prometheus-statsd-exporter")
891 (version "0.28.0")
892 (source
893 (origin
894 (method git-fetch)
895 (uri (git-reference
896 (url "https://github.com/prometheus/statsd_exporter")
897 (commit (string-append "v" version))))
898 (file-name (git-file-name name version))
899 (sha256
900 (base32 "0h7ypmsx1j6x1p5wdj03i3jzwms7ab03asn2capl1gg6x07k57w7"))))
901 (build-system go-build-system)
902 (arguments
903 (list
904 #:import-path "github.com/prometheus/statsd_exporter"
905 #:embed-files #~(list "landing_page.css" "landing_page.html")))
906 (native-inputs
907 (list go-github-com-stvp-go-udp-testing))
908 (propagated-inputs
909 (list go-github-com-alecthomas-kingpin-v2
910 go-github-com-go-kit-log
911 go-github-com-golang-groupcache
912 go-github-com-prometheus-client-golang
913 go-github-com-prometheus-client-model
914 go-github-com-prometheus-common
915 go-github-com-prometheus-exporter-toolkit
916 go-gopkg-in-yaml-v2))
917 (home-page "https://github.com/prometheus/statsd_exporter")
918 (synopsis "StatsD to Prometheus metrics exporter")
919 (description
920 "The StatsD exporter is a drop-in replacement for
921@url{https://github.com/statsd/statsd,StatsD}. The exporter translates StatsD
922metrics to Prometheus metrics via configured mapping rules. This package
923provides a Golang module and @code{statsd_exporter} executable command.")
924 (license license:asl2.0)))
925
926(define-public go-github-com-sourcegraph-mountinfo
927 (package
928 (name "go-github-com-sourcegraph-mountinfo")
929 (properties '((commit . "e539465d544015a75056b3c77da212861cf7c223")
930 (revision . "0")
931 (go-pseudo-version . "0.0.0-20260429092751-e539465d5440")))
932 (version (git-version "0.0.0"
933 (assoc-ref properties 'revision)
934 (assoc-ref properties 'commit)))
935 (source
936 (origin
937 (method git-fetch)
938 (uri (git-reference
939 (url "https://github.com/sourcegraph/mountinfo")
940 (commit (assoc-ref properties 'commit))))
941 (file-name (git-file-name name version))
942 (sha256
943 (base32 "0izpsrkzxdw3b12wxgdah8c6klbddkryzcawd7fvvdwrcl7bsxjn"))))
944 (build-system go-build-system)
945 (arguments
946 (list
947 #:import-path "github.com/sourcegraph/mountinfo"
948 #:test-flags
949 #~(list "-skip" (string-join
950 ;; findSysfsMountpoint: no sysfs mountpoint found
951 (list "Test_DeviceName_VirtualFilesystem"
952 "Test_DeviceName_SmokeTest")
953 "|"))))
954 (native-inputs
955 (list go-github-com-google-go-cmp))
956 (propagated-inputs
957 (list go-github-com-moby-sys-mountinfo
958 go-github-com-prometheus-client-golang
959 go-github-com-sourcegraph-log
960 go-golang-org-x-sys))
961 (home-page "https://github.com/sourcegraph/mountinfo")
962 (synopsis "Prometheus info metric for advertizing block device names")
963 (description
964 "Package mountinfo provides a Prometheus collector that advertises the
965names of block storage devices backing the requested file paths.")
966 (license license:asl2.0)))
967
968(define-public go-github-com-yeya24-promlinter
969 (package
970 (name "go-github-com-yeya24-promlinter")
971 (version "0.3.0")
972 (source
973 (origin
974 (method git-fetch)
975 (uri (git-reference
976 (url "https://github.com/yeya24/promlinter")
977 (commit (string-append "v" version))))
978 (file-name (git-file-name name version))
979 (sha256
980 (base32 "0flmi0adwqhr6cbq2l73sngwpri37gdmi74lymz0w382pwhfyri1"))))
981 (build-system go-build-system)
982 (arguments
983 (list
984 #:import-path "github.com/yeya24/promlinter"))
985 (native-inputs
986 (list go-github-com-stretchr-testify))
987 (propagated-inputs
988 (list go-github-com-prometheus-client-golang
989 go-github-com-prometheus-client-model
990 go-gopkg-in-alecthomas-kingpin-v2
991 go-gopkg-in-yaml-v2))
992 (home-page "https://github.com/yeya24/promlinter")
993 (synopsis "Go linter for Prometheus metrics")
994 (description
995 "This package provides a linter for checking Prometheus metrics name via
996promlint.")
997 (license license:asl2.0)))
998
999(define-public go-go-opentelemetry-io-contrib-bridges-prometheus
1000 (package
1001 (name "go-go-opentelemetry-io-contrib-bridges-prometheus")
1002 (version "0.69.0")
1003 (source
1004 (origin
1005 (method git-fetch)
1006 (uri (git-reference
1007 (url "https://github.com/open-telemetry/opentelemetry-go-contrib")
1008 (commit (go-version->git-ref version
1009 #:subdir "bridges/prometheus"))))
1010 (file-name (git-file-name name version))
1011 (sha256
1012 (base32 "1bm680k5ckpzjpsqzxswsylc9gxiw2flwkjlwmvh6hs50bgbpyjl"))))
1013 (build-system go-build-system)
1014 (arguments
1015 (list
1016 #:import-path "go.opentelemetry.io/contrib/bridges/prometheus"
1017 #:unpack-path "go.opentelemetry.io/contrib"))
1018 (native-inputs
1019 (list go-github-com-stretchr-testify))
1020 (propagated-inputs
1021 (list go-github-com-prometheus-client-golang
1022 go-github-com-prometheus-client-model
1023 go-go-opentelemetry-io-otel
1024 go-go-opentelemetry-io-otel-sdk
1025 go-go-opentelemetry-io-otel-sdk-metric))
1026 (home-page "https://go.opentelemetry.io/contrib")
1027 (synopsis "Bridge from Prometheus to OpenTelemetry")
1028 (description
1029 "Package prometheus provides a bridge from Prometheus to
1030@code{OpenTelemetry}.")
1031 (license license:asl2.0)))
1032
1033;;;
1034;;; Executables:
1035;;;
1036
1037(define-public prometheus-alertmanager
1038 (package/inherit go-github-com-prometheus-alertmanager
1039 (name "prometheus-alertmanager")
1040 (arguments
1041 (substitute-keyword-arguments arguments
1042 ((#:import-path _)
1043 "github.com/prometheus/alertmanager/cmd/alertmanager")
1044 ((#:install-source? _ #t) #f)
1045 ((#:skip-build? _ #t) #f)
1046 ((#:tests? _ #t) #f)))
1047 (native-inputs
1048 (package-propagated-inputs go-github-com-prometheus-alertmanager))
1049 (propagated-inputs '())
1050 (inputs '())))
1051
1052;;;
1053;;; Avoid adding new packages to the end of this file. To reduce the chances
1054;;; of a merge conflict, place them above in alphabetic order.
1055;;;