All URIs are relative to http://localhost
Method | HTTP request | Description |
---|---|---|
GetLatestTraces | Get /api/{org_id}/{stream_name}/traces/latest | GetLatestTraces |
PostTraces | Post /api/{org_id}/traces | TracesIngest |
SearchResponse GetLatestTraces(ctx, orgId, streamName).From(from).Size(size).StartTime(startTime).EndTime(endTime).Filter(filter).Timeout(timeout).Execute()
GetLatestTraces
package main
import (
"context"
"fmt"
"os"
openobserve "github.com/rachzy/sdk-go-openobserve"
)
func main() {
orgId := "orgId_example" // string | Organization name
streamName := "streamName_example" // string | Stream name
from := int64(789) // int64 | from
size := int64(789) // int64 | size
startTime := int64(789) // int64 | start time
endTime := int64(789) // int64 | end time
filter := "filter_example" // string | filter, eg: a=b AND c=d (optional)
timeout := int64(789) // int64 | timeout, seconds (optional)
configuration := openobserve.NewConfiguration()
apiClient := openobserve.NewAPIClient(configuration)
resp, r, err := apiClient.TracesAPI.GetLatestTraces(context.Background(), orgId, streamName).From(from).Size(size).StartTime(startTime).EndTime(endTime).Filter(filter).Timeout(timeout).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TracesAPI.GetLatestTraces``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetLatestTraces`: SearchResponse
fmt.Fprintf(os.Stdout, "Response from `TracesAPI.GetLatestTraces`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
orgId | string | Organization name | |
streamName | string | Stream name |
Other parameters are passed through a pointer to a apiGetLatestTracesRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
from | int64 | from | size | int64 | size | startTime | int64 | start time | endTime | int64 | end time | filter | string | filter, eg: a=b AND c=d | timeout | int64 | timeout, seconds |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
IngestionResponse PostTraces(ctx, orgId).Body(body).Execute()
TracesIngest
package main
import (
"context"
"fmt"
"os"
openobserve "github.com/rachzy/sdk-go-openobserve"
)
func main() {
orgId := "orgId_example" // string |
body := "body_example" // string | ExportTraceServiceRequest
configuration := openobserve.NewConfiguration()
apiClient := openobserve.NewAPIClient(configuration)
resp, r, err := apiClient.TracesAPI.PostTraces(context.Background(), orgId).Body(body).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TracesAPI.PostTraces``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PostTraces`: IngestionResponse
fmt.Fprintf(os.Stdout, "Response from `TracesAPI.PostTraces`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
orgId | string |
Other parameters are passed through a pointer to a apiPostTracesRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
body | string | ExportTraceServiceRequest |
- Content-Type: application/x-protobuf
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]