Skip to content

Commit

Permalink
Update the endpoint name format to <Method>:<Path> in eBPF Access L…
Browse files Browse the repository at this point in the history
…og Receiver. (#12564)
  • Loading branch information
mrproliu authored Aug 23, 2024
1 parent f02a6a2 commit a81437f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/en/changes/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
* Support sort queries on metrics generated by eBPF receiver.
* Fix the compatibility with Grafana 11 when using label_values query variables.
* Nacos as config server and cluster coordinator supports configuration contextPath.
* Update the endpoint name format to `<Method>:<Path>` in eBPF Access Log Receiver.

#### UI

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import io.vavr.Tuple2;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.skywalking.apm.network.common.v3.DetectPoint;
import org.apache.skywalking.apm.network.ebpf.accesslog.v3.AccessLogConnection;
import org.apache.skywalking.apm.network.ebpf.accesslog.v3.AccessLogConnectionTLSMode;
Expand Down Expand Up @@ -421,7 +422,8 @@ protected String buildProtocolEndpointName(ConnectionInfo connectionInfo, Access
switch (protocol.getProtocolCase()) {
case HTTP:
final AccessLogHTTPProtocol http = protocol.getHttp();
return namingControl.formatEndpointName(serviceName, http.getRequest().getPath());
return namingControl.formatEndpointName(serviceName,
StringUtils.upperCase(http.getRequest().getMethod().name()) + ":" + http.getRequest().getPath());
default:
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ cases:
expected: expected/metrics-sorted-has-value.yml

# service endpoint level metrics
- query: swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics exec --expression=kubernetes_service_endpoint_call_cpm --service-name=details.default --endpoint-name=/details/0
- query: swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics exec --expression=kubernetes_service_endpoint_call_cpm --service-name=details.default --endpoint-name=GET:/details/0
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics exec --expression=kubernetes_service_endpoint_http_call_cpm --service-name=details.default --endpoint-name=/details/0
- query: swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics exec --expression=kubernetes_service_endpoint_http_call_cpm --service-name=details.default --endpoint-name=GET:/details/0
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics exec --expression="top_n(kubernetes_service_endpoint_call_duration,10,des)" --service-name=details.default
expected: expected/metrics-sorted-has-value.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
# limitations under the License.

{{- contains . }}
- id: {{ b64enc "details.default" }}.1_{{ b64enc "/details/0" }}
name: /details/0
- id: {{ b64enc "details.default" }}.1_{{ b64enc "GET:/details/0" }}
name: GET:/details/0
{{- end }}

0 comments on commit a81437f

Please sign in to comment.