Skip to content

Commit 312b9ed

Browse files
authored
chore: move location of tool metrics from thirdparty to telemetry folder (#1024)
it felt a bit odd to me that the tool metrics logic lived under the `thirdparty` folder. As a new-comer it wasn't obvious this lived here, and this folder does seem dedicated to third party tooling (polar, slack, etc). This PR moves it to a dedicated `telemetry` folder. I considered having it in `o11y` but I felt that folder should be dedicated to the actual server logging tooling (slog, metrics, etc). I'm doing this in preparation of work to start fetching function logs from clickhouse to our dashboard.
1 parent 0388f5a commit 312b9ed

File tree

23 files changed

+33
-33
lines changed

23 files changed

+33
-33
lines changed

server/cmd/gram/deps.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"github.com/redis/go-redis/extra/redisotel/v9"
2525
"github.com/redis/go-redis/v9"
2626
"github.com/speakeasy-api/gram/server/internal/inv"
27-
tm "github.com/speakeasy-api/gram/server/internal/thirdparty/toolmetrics"
27+
tm "github.com/speakeasy-api/gram/server/internal/telemetry"
2828
"github.com/superfly/fly-go/tokens"
2929
"github.com/urfave/cli/v2"
3030
"github.com/urfave/cli/v2/altsrc"

server/internal/agents/agents.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
"github.com/speakeasy-api/gram/server/internal/mv"
3030
"github.com/speakeasy-api/gram/server/internal/o11y"
3131
"github.com/speakeasy-api/gram/server/internal/thirdparty/openrouter"
32-
tm "github.com/speakeasy-api/gram/server/internal/thirdparty/toolmetrics"
32+
tm "github.com/speakeasy-api/gram/server/internal/telemetry"
3333
"github.com/speakeasy-api/gram/server/internal/toolsets"
3434
"github.com/speakeasy-api/gram/server/internal/urn"
3535
)

server/internal/chat/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030
"github.com/speakeasy-api/gram/server/internal/mv"
3131
"github.com/speakeasy-api/gram/server/internal/o11y"
3232
"github.com/speakeasy-api/gram/server/internal/thirdparty/openrouter"
33-
tm "github.com/speakeasy-api/gram/server/internal/thirdparty/toolmetrics"
33+
tm "github.com/speakeasy-api/gram/server/internal/telemetry"
3434
"github.com/speakeasy-api/gram/server/internal/toolsets"
3535
)
3636

server/internal/gateway/proxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"time"
2121

2222
"github.com/speakeasy-api/gram/server/internal/templates"
23-
tm "github.com/speakeasy-api/gram/server/internal/thirdparty/toolmetrics"
23+
tm "github.com/speakeasy-api/gram/server/internal/telemetry"
2424
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
2525
"go.opentelemetry.io/otel/codes"
2626
"go.opentelemetry.io/otel/metric"

server/internal/gateway/proxy_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"github.com/speakeasy-api/gram/server/internal/functions"
2222
"github.com/speakeasy-api/gram/server/internal/guardian"
2323
"github.com/speakeasy-api/gram/server/internal/testenv"
24-
tm "github.com/speakeasy-api/gram/server/internal/thirdparty/toolmetrics"
24+
tm "github.com/speakeasy-api/gram/server/internal/telemetry"
2525
"github.com/speakeasy-api/gram/server/internal/urn"
2626
)
2727

server/internal/gateway/resources.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"github.com/speakeasy-api/gram/server/internal/attr"
1515
"github.com/speakeasy-api/gram/server/internal/functions"
1616
"github.com/speakeasy-api/gram/server/internal/oops"
17-
tm "github.com/speakeasy-api/gram/server/internal/thirdparty/toolmetrics"
17+
tm "github.com/speakeasy-api/gram/server/internal/telemetry"
1818
"go.opentelemetry.io/otel/codes"
1919
"go.opentelemetry.io/otel/trace"
2020
)

server/internal/gateway/security.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717

1818
"github.com/speakeasy-api/gram/server/internal/attr"
1919
"github.com/speakeasy-api/gram/server/internal/cache"
20-
tm "github.com/speakeasy-api/gram/server/internal/thirdparty/toolmetrics"
20+
tm "github.com/speakeasy-api/gram/server/internal/telemetry"
2121
)
2222

2323
func processSecurity(

server/internal/instances/impl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313

1414
"github.com/google/uuid"
1515
"github.com/jackc/pgx/v5/pgxpool"
16-
tm "github.com/speakeasy-api/gram/server/internal/thirdparty/toolmetrics"
16+
tm "github.com/speakeasy-api/gram/server/internal/telemetry"
1717
"github.com/speakeasy-api/gram/server/internal/urn"
1818
"go.opentelemetry.io/otel/metric"
1919
"go.opentelemetry.io/otel/trace"

server/internal/logs/impl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"github.com/speakeasy-api/gram/server/internal/conv"
1717
"github.com/speakeasy-api/gram/server/internal/middleware"
1818
"github.com/speakeasy-api/gram/server/internal/oops"
19-
tm "github.com/speakeasy-api/gram/server/internal/thirdparty/toolmetrics"
19+
tm "github.com/speakeasy-api/gram/server/internal/telemetry"
2020
"go.opentelemetry.io/otel"
2121
"go.opentelemetry.io/otel/trace"
2222
goahttp "goa.design/goa/v3/http"

server/internal/logs/listLogs_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
"github.com/google/uuid"
1111
"github.com/speakeasy-api/gram/server/gen/logs"
12-
"github.com/speakeasy-api/gram/server/internal/thirdparty/toolmetrics"
12+
"github.com/speakeasy-api/gram/server/internal/telemetry"
1313
"github.com/stretchr/testify/require"
1414
)
1515

@@ -193,15 +193,15 @@ func TestListLogs_TimeRangeFilter(t *testing.T) {
193193
id, err := fromTimeV7(baseTime.Add(time.Duration(i) * time.Minute))
194194
require.NoError(t, err)
195195

196-
err = ti.chClient.Log(ctx, toolmetrics.ToolHTTPRequest{
196+
err = ti.chClient.Log(ctx, telemetry.ToolHTTPRequest{
197197
ID: id.String(),
198198
Ts: baseTime.Add(time.Duration(i) * time.Minute),
199199
OrganizationID: orgID,
200200
ProjectID: projectID,
201201
DeploymentID: deploymentID,
202202
ToolID: toolID,
203203
ToolURN: "urn:tool:test",
204-
ToolType: toolmetrics.ToolTypeHTTP,
204+
ToolType: telemetry.ToolTypeHTTP,
205205
TraceID: id.String()[:32],
206206
SpanID: id.String()[:16],
207207
HTTPMethod: "GET",
@@ -324,15 +324,15 @@ func TestListLogs_VerifyLogFields(t *testing.T) {
324324
baseTime := time.Unix(id.Time().UnixTime()).
325325
UTC().Add(-10 * time.Minute)
326326

327-
err = ti.chClient.Log(ctx, toolmetrics.ToolHTTPRequest{
327+
err = ti.chClient.Log(ctx, telemetry.ToolHTTPRequest{
328328
ID: id.String(),
329329
Ts: baseTime,
330330
OrganizationID: orgID,
331331
ProjectID: projectID,
332332
DeploymentID: deploymentID,
333333
ToolID: toolID,
334334
ToolURN: toolURN,
335-
ToolType: toolmetrics.ToolTypeHTTP,
335+
ToolType: telemetry.ToolTypeHTTP,
336336
TraceID: traceID,
337337
SpanID: spanID,
338338
HTTPMethod: "POST",
@@ -408,15 +408,15 @@ func insertTestLogs(t *testing.T, ctx context.Context, ti *testInstance, project
408408
id, err := fromTimeV7(baseTime.Add(time.Duration(i) * time.Minute))
409409
require.NoError(t, err)
410410

411-
err = ti.chClient.Log(ctx, toolmetrics.ToolHTTPRequest{
411+
err = ti.chClient.Log(ctx, telemetry.ToolHTTPRequest{
412412
ID: id.String(),
413413
Ts: baseTime.Add(time.Duration(i) * time.Minute),
414414
OrganizationID: orgID,
415415
ProjectID: projectID,
416416
DeploymentID: deploymentID,
417417
ToolID: toolID,
418418
ToolURN: "urn:tool:test",
419-
ToolType: toolmetrics.ToolTypeHTTP,
419+
ToolType: telemetry.ToolTypeHTTP,
420420
TraceID: id.String()[:32],
421421
SpanID: id.String()[:16],
422422
HTTPMethod: "GET",

0 commit comments

Comments
 (0)