Commit graph

8 commits

Author SHA1 Message Date
Ingmar Stein
2ccb38d1d2
Server: Support simultaneous TCP and Unix domain socket serving (#118627)
* Server: Support simultaneous TCP and Unix domain socket serving

This commit introduces the 'serve_on_socket' configuration option,
allowing Grafana to listen on both a TCP port and a Unix domain socket
simultaneously.

Rationale:
- Performance: Provides a high-performance, low-latency connection path
  for local reverse proxies or load balancers using Unix domain sockets.
- Observability: Maintains direct TCP access, enabling sidecars or
  external services (like Prometheus) to scrape metrics or perform
  health checks without requiring UDS support.

Key changes:
- pkg/setting: Added ServeOnSocket to Cfg and updated parsing logic to
  always load socket-related settings regardless of the primary protocol.
- pkg/api: Refactored HTTPServer to support multiple concurrent
  listeners using errgroup. Added getListeners to return both the
  primary TCP/UDS listener and the optional additional UDS listener.
- conf: Added serve_on_socket to defaults.ini.
- docs: Updated configuration documentation for the new setting.

* Tests: Add TestHTTPServer_getListeners to verify multiple listeners

* Server: address review feedback for simultaneous TCP and UDS serving

* Fix linter findings
2026-02-27 09:25:24 +01:00
lean.dev
5522c3a01b
Grafana: Adds support for PKCS1 encrypted certs (#93451) 2024-09-19 15:03:06 -03:00
lean.dev
b5e32b31b1
Grafana: Enables use of encrypted certificates with password for https (#91418) 2024-08-06 19:18:32 -03:00
chalapat
65c0669f01
Server: Reload TLS certs without a server restart (#83589)
* server: reload of grafana server certs when renewed without restart.

Signed-off-by: Rao, B V Chalapathi <b_v_chalapathi.rao@nokia.com>

* server: reload of grafana server certs when renewed without restart.

Signed-off-by: Rao, B V Chalapathi <b_v_chalapathi.rao@nokia.com>

* Update http_server.go

* Update docs/sources/setup-grafana/configure-grafana/_index.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update http_server.go

Address the comments

* Update docs/sources/setup-grafana/configure-grafana/_index.md

Co-authored-by: Dan Cech <dan@aussiedan.com>

* Update http_server.go

Align the spaces

* Update http_server.go

* Update http_server.go

* Update pkg/api/http_server.go

Co-authored-by: Dan Cech <dan@aussiedan.com>

---------

Signed-off-by: Rao, B V Chalapathi <b_v_chalapathi.rao@nokia.com>
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: Dan Cech <dan@aussiedan.com>
2024-03-22 17:13:22 +02:00
Serge Zaitsev
324310abbc
Chore: Fix goimports grouping in pkg/api (#62419)
* fix goimports

* fix goimports order
2023-01-30 08:18:26 +00:00
Marcus Efraimsson
9eb2cd537d
Plugins: Make backend plugin metrics endpoints available with optional authentication (#46467)
* add new endpoint without auth+config

* add cfg check

* fit lint issue

* Add basic auth support

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>

* WIP docs

* Update docs/sources/administration/view-server/internal-metrics.md

Co-authored-by: Dave Henderson <dhenderson@gmail.com>

* update instructions

Co-authored-by: Will Browne <will.browne@grafana.com>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Dave Henderson <dhenderson@gmail.com>
2022-03-29 11:18:26 +02:00
Emil Tullstedt
b68634fbb4
Tests: Batch of GoConvey to Testify conversions (#27008) 2020-08-14 14:43:25 +02:00
Bob Shannon
16ff8a182b Re-organize packages and add basic auth test 2018-11-19 13:54:13 -05:00