Loading...
Loading...
Compare original and translation side by side
undefinedundefined
3. **Update Alloy config** to use private DNS names from Grafana Cloud console:
```alloy
prometheus.remote_write "cloud_private" {
endpoint {
// Use private DNS name instead of public endpoint
url = "https://prometheus-private.us-east-0.grafana.net/api/prom/push"
basic_auth {
username = sys.env("PROM_USER")
password = sys.env("GRAFANA_CLOUD_API_KEY")
}
}
}
loki.write "cloud_private" {
endpoint {
url = "https://logs-private.us-east-0.grafana.net/loki/api/v1/push"
basic_auth {
username = sys.env("LOKI_USER")
password = sys.env("GRAFANA_CLOUD_API_KEY")
}
}
}
3. 更新 Alloy 配置,使用 Grafana Cloud 控制台提供的私有 DNS 名称:
```alloy
prometheus.remote_write "cloud_private" {
endpoint {
// Use private DNS name instead of public endpoint
url = "https://prometheus-private.us-east-0.grafana.net/api/prom/push"
basic_auth {
username = sys.env("PROM_USER")
password = sys.env("GRAFANA_CLOUD_API_KEY")
}
}
}
loki.write "cloud_private" {
endpoint {
url = "https://logs-private.us-east-0.grafana.net/loki/api/v1/push"
basic_auth {
username = sys.env("LOKI_USER")
password = sys.env("GRAFANA_CLOUD_API_KEY")
}
}
}resource "aws_vpc_endpoint" "grafana_metrics" {
vpc_id = var.vpc_id
service_name = var.grafana_metrics_service_name # from Grafana Cloud console
vpc_endpoint_type = "Interface"
subnet_ids = var.subnet_ids
security_group_ids = [aws_security_group.grafana_endpoint.id]
private_dns_enabled = true
tags = { Name = "grafana-metrics-privatelink" }
}
resource "aws_vpc_endpoint" "grafana_logs" {
vpc_id = var.vpc_id
service_name = var.grafana_logs_service_name
vpc_endpoint_type = "Interface"
subnet_ids = var.subnet_ids
security_group_ids = [aws_security_group.grafana_endpoint.id]
private_dns_enabled = true
tags = { Name = "grafana-logs-privatelink" }
}resource "aws_vpc_endpoint" "grafana_metrics" {
vpc_id = var.vpc_id
service_name = var.grafana_metrics_service_name # from Grafana Cloud console
vpc_endpoint_type = "Interface"
subnet_ids = var.subnet_ids
security_group_ids = [aws_security_group.grafana_endpoint.id]
private_dns_enabled = true
tags = { Name = "grafana-metrics-privatelink" }
}
resource "aws_vpc_endpoint" "grafana_logs" {
vpc_id = var.vpc_id
service_name = var.grafana_logs_service_name
vpc_endpoint_type = "Interface"
subnet_ids = var.subnet_ids
security_group_ids = [aws_security_group.grafana_endpoint.id]
private_dns_enabled = true
tags = { Name = "grafana-logs-privatelink" }
}undefinedundefined
**Note:** Azure Private Link requires pre-registering your Subscription IDs with Grafana Support before setup.
**注意:** 在设置 Azure Private Link 之前,需要先将你的订阅 ID 注册到 Grafana 支持团队。gcloud compute forwarding-rules create grafana-metrics-psc \
--region=us-east1 \
--network=my-vpc \
--subnet=my-subnet \
--address=grafana-metrics-ip \
--target-service-attachment=projects/grafana-cloud/regions/us-east1/serviceAttachments/metricsgcloud compute forwarding-rules create grafana-metrics-psc \
--region=us-east1 \
--network=my-vpc \
--subnet=my-subnet \
--address=grafana-metrics-ip \
--target-service-attachment=projects/grafana-cloud/regions/us-east1/serviceAttachments/metricsundefinedundefined
PDC creates an encrypted tunnel from Grafana Cloud back into your private network for data source queries. It's the reverse direction of PrivateLink (pull vs push).
PDC 会创建一条从 Grafana Cloud 反向连接到你的私有网络的加密隧道,用于数据源查询。它与 PrivateLink 的方向相反(拉取 vs 推送)。| Scenario | Solution |
|---|---|
| Push metrics/logs/traces from AWS | AWS PrivateLink |
| Push metrics/logs/traces from Azure | Azure Private Link |
| Push metrics/logs/traces from GCP | GCP Private Service Connect |
| Query private DB/Prometheus from Grafana | Private Data Source Connect (PDC) |
| On-premises with no cloud provider | Grafana Agent with TLS over internet |
| 场景 | 解决方案 |
|---|---|
| 从 AWS 推送指标/日志/链路追踪 | AWS PrivateLink |
| 从 Azure 推送指标/日志/链路追踪 | Azure Private Link |
| 从 GCP 推送指标/日志/链路追踪 | GCP Private Service Connect |
| 从 Grafana 查询私有数据库/Prometheus | 私有数据源连接(PDC) |
| 无云服务商的本地环境 | 启用 TLS 的 Grafana Agent(通过公网) |