Skip to content

Commit

Permalink
use the service name as the kong proxy id (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcollins-axway authored Dec 4, 2023
1 parent 1ac30e6 commit c57fbee
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
14 changes: 1 addition & 13 deletions pkg/gateway/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func newKongAPI(
endpoints []apic.EndpointDefinition,
) KongAPI {
return KongAPI{
id: *route.ID,
id: *service.Name,
name: *service.Name,
description: oasSpec.Description(),
version: oasSpec.Version(),
Expand Down Expand Up @@ -333,15 +333,3 @@ func isPublished(api *KongAPI, c cache.Cache) (bool, string) {
}
return true, checksum
}

func isValidAuthTypeAndEnabled(p *klib.Plugin) bool {
if !*p.Enabled {
return false
}
for _, availableAuthName := range []string{"basic-auth", "oauth2", "key-auth"} {
if *p.Name == availableAuthName {
return true
}
}
return false
}
2 changes: 1 addition & 1 deletion pkg/traceability/processor/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (m *MetricsProcessor) process(entry TrafficLogEntry) (bool, error) {

func (m *MetricsProcessor) updateMetric(entry TrafficLogEntry) {
apiDetails := models.APIDetails{
ID: entry.Route.ID,
ID: entry.Service.Name,
Name: entry.Service.Name,
Stage: entry.Route.Name,
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/traceability/processor/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func createSummaryEvent(ktle TrafficLogEntry, teamID string, txnid string) (*tra
SetTeam(teamID).
SetEntryPoint(ktle.Service.Protocol, ktle.Request.Method, ktle.Request.URI, ktle.Request.URL).
SetDuration(ktle.Latencies.Request).
SetProxyWithStage(sdkUtil.FormatProxyID(ktle.Route.ID), ktle.Service.Name, ktle.Route.Name, 1)
SetProxyWithStage(sdkUtil.FormatProxyID(ktle.Service.Name), ktle.Service.Name, ktle.Route.Name, 1)

if ktle.Consumer != nil {
builder.SetApplication(sdkUtil.FormatApplicationID(ktle.Consumer.ID), ktle.Consumer.Username)
Expand Down

0 comments on commit c57fbee

Please sign in to comment.