First deploy the demo app.
kubectl apply -f tns.yaml
Make sure tiller is installed in your cluster.
Add our chart repository
helm repo add loki https://grafana.github.io/loki/charts
package main | |
import ( | |
"context" | |
"math" | |
"github.com/grafana/loki/v3/pkg/storage/stores/shipper/indexshipper/tsdb/index" | |
"github.com/prometheus/common/model" | |
"github.com/prometheus/prometheus/model/labels" | |
) |
package main | |
import ( | |
"context" | |
"fmt" | |
"io" | |
"sync" | |
"time" | |
"cloud.google.com/go/storage" |
package main | |
import ( | |
"bytes" | |
"context" | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"net/http" |
server: | |
http_listen_port: 3100 | |
grpc_listen_port: 0 | |
clients: | |
- url: https://<user id>:<api secret>@logs-prod-us-central1.grafana.net/loki/api/v1/push | |
positions: | |
filename: /opt/promtail/positions.yaml |
scrape_configs: | |
- job_name: monitoring | |
ec2_sd_configs: | |
- region: us-east-1 | |
port: 9100 | |
relabel_configs: | |
- action: replace | |
regex: ".*" | |
replacement: /var/log/nginx/access.log | |
target_label: __path__ |
First deploy the demo app.
kubectl apply -f tns.yaml
Make sure tiller is installed in your cluster.
Add our chart repository
helm repo add loki https://grafana.github.io/loki/charts
{ | |
"go.testFlags": [ | |
"-v", | |
"-count=1" | |
], | |
"go.languageServerExperimentalFeatures": { | |
"format": false, | |
"autoComplete": true, | |
"rename": true, | |
"goToDefinition": true, |
[{"body":" General Notes Cortex has evolved over several years, and the command-line options sometimes reflect this heritage. In some cases the default value for options is not the recommended value, and in some cases names do not reflect the true meaning. We do intend to clean this up, but it requires a lot of care to avoid breaking existing installations. In the meantime we regret the inconvenience.\nDuration arguments should be specified with a unit like 5s or 3h. Valid time units are \u0026ldquo;ms\u0026rdquo;, \u0026ldquo;s\u0026rdquo;, \u0026ldquo;m\u0026rdquo;, \u0026ldquo;h\u0026rdquo;.\nQuerier -querier.max-concurrent The maximum number of top-level PromQL queries that will execute at the same time, per querier process. If using the query frontend, this should be set to at least (querier.worker-parallelism * number of query frontend replicas). Otherwise queries may queue in the queriers and not the frontend, which will affect QoS.\n -querier.query-parallelism This refers to database queries against t |
2019-11-07T11:41:14-05:00 {filename="/var/log/pods/prod_distributor-6c946d865-dvlts_2d056b2a-f95b-11e9-96eb-42010a800155/distributor/0.log", instance="distributor-6c946d865-dvlts"} {"level":"warn","ts":"2019-11-07T16:41:14.875Z","caller":"clientv3/retry_interceptor.go:61","msg":"retrying of unary invoker failed","target":"endpoint://client-726fc2eb-ef3c-43e5-9a88-f45ab6a4722f/etcd-client.prod.svc.cluster.local.:2379","attempt":0,"error":"rpc error: code = Unavailable desc = etcdserver: request timed out"} | |
2019-11-07T11:41:14-05:00 {filename="/var/log/pods/prod_distributor-6c946d865-4vw24_24943bd2-f95b-11e9-96eb-42010a800155/distributor/0.log", instance="distributor-6c946d865-4vw24"} {"level":"warn","ts":"2019-11-07T16:41:14.876Z","caller":"clientv3/retry_interceptor.go:61","msg":"retrying of unary invoker failed","target":"endpoint://client-5375753c-f80b-48e1-bd53-117108a0b39b/etcd-client.prod.svc.cluster.local.:2379","attempt":0,"error":"rpc error: code = Unavailable desc = etcdse |
kubectl run --generator=run-pod/v1 dnsutil --image tutum/dnsutils -i --tty --rm | |
root@dnsutil:/# dig grafana.default.svc.us-central1.local |