File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed
internal/cmd/integration-tests/tests/read-log-file Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 1+ > ** Deprecation notice** : Grafana Agent has been deprecated and is now in
2+ > Long-Term Support mode. We recommend migrating to the new Grafana Alloy
3+ > collector, which is built on the foundation of Grafana Agent Flow.
4+ >
5+ > For more information, read our blog posts about Alloy and how to easily
6+ > migrate from Agent to Alloy:
7+ >
8+ > * [ Alloy announcement blog post] ( https://grafana.com/blog/2024/04/09/grafana-alloy-opentelemetry-collector-with-prometheus-pipelines/ )
9+ > * [ Alloy FAQ] ( https://grafana.com/blog/2024/04/09/grafana-agent-to-grafana-alloy-opentelemetry-collector-faq/ )
10+ > * [ Migrate to Alloy] ( https://grafana.com/docs/alloy/latest/tasks/migrate/ )
11+
112<p align =" center " ><img src =" docs/sources/assets/logo_and_name.png " alt =" Grafana Agent logo " ></p >
213
314Grafana Agent is an OpenTelemetry Collector distribution with configuration
Original file line number Diff line number Diff line change @@ -17,10 +17,12 @@ func TestReadLogFile(t *testing.T) {
1717 err := common .FetchDataFromURL (query , & logResponse )
1818 assert .NoError (c , err )
1919 if assert .NotEmpty (c , logResponse .Data .Result ) {
20- assert .Equal (c , logResponse .Data .Result [0 ].Stream ["filename" ], "logs.txt" )
21- logs := make ([]string , len (logResponse .Data .Result [0 ].Values ))
22- for i , valuePair := range logResponse .Data .Result [0 ].Values {
23- logs [i ] = valuePair [1 ]
20+ logs := make ([]string , 0 )
21+ for _ , result := range logResponse .Data .Result {
22+ assert .Equal (c , result .Stream ["filename" ], "logs.txt" )
23+ for _ , valuePair := range result .Values {
24+ logs = append (logs , valuePair [1 ])
25+ }
2426 }
2527 assert .Contains (c , logs , "[2023-10-02 14:25:43] INFO: Starting the web application..." )
2628 }
You can’t perform that action at this time.
0 commit comments