Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknwon route Error in Spring cloud Gateway #3429

Closed
Junnyjun opened this issue Nov 16, 2023 · 3 comments
Closed

Unknwon route Error in Spring cloud Gateway #3429

Junnyjun opened this issue Nov 16, 2023 · 3 comments
Labels
agent-java community Issues and PRs created by the community triage

Comments

@Junnyjun
Copy link

Junnyjun commented Nov 16, 2023

Describe the bug

When I use spring cloud gateway, I get unknown route in fleet.
image

Steps to reproduce

  1. This is the gradle I used
plugins {
	id 'org.springframework.boot' version '3.1.5'
	id 'io.spring.dependency-management' version '1.1.3'
	id 'org.jetbrains.kotlin.jvm' version '1.8.22'
	id 'org.jetbrains.kotlin.plugin.spring' version '1.8.22'
}

group = 'com.test'
version = '0.0.1'

java {
	sourceCompatibility = '17'
}

jar {
	enabled = false
}

repositories {
	mavenCentral()
}

springBoot {
	buildInfo()
}

ext {
	set('springCloudVersion', "2022.0.4")
}

dependencies {
	implementation 'org.jetbrains.kotlin:kotlin-reflect'
	implementation 'org.springframework.boot:spring-boot-starter-actuator'
	implementation 'org.springframework.cloud:spring-cloud-starter-gateway'
	implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
	implementation 'org.springframework.cloud:spring-cloud-starter-circuitbreaker-reactor-resilience4j'

	implementation 'org.springframework.cloud:spring-cloud-starter-config'
	implementation 'io.opentelemetry:opentelemetry-api:1.31.0'
	testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

dependencyManagement {
	imports {
		mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
	}
}

tasks.withType(KotlinCompile) {
	kotlinOptions {
		freeCompilerArgs += '-Xjsr305=strict'
		jvmTarget = '17'
	}
}

tasks.named('test') {
	useJUnitPlatform()
}
  1. My apm version -> elastic-apm-agent-1.43.0.jar
  2. execute script is
/boin/JAVA17 -javaagent:/elastic-apm.jar -Delastic.apm.service_name=gateway-servicemesh -Delastic.apm.server_url=http://localhost:8200 -Delastic.apm.environment=dev -Delastic.apm.application_packages=gateway -jar -Dspring.profiles.active=dev my-app.jar

Expected behavior

Occurred when calling a service after connecting a gateway, service to eureka.

Tasks

Preview Give feedback
No tasks being tracked yet.
@github-actions github-actions bot added agent-java community Issues and PRs created by the community triage labels Nov 16, 2023
@jackshirazi
Copy link
Contributor

@videnkz
Copy link
Contributor

videnkz commented Nov 28, 2023

Hi @Junnyjun ,
Solution from link provided above contains solution for your case - try to use https://www.elastic.co/guide/en/apm/agent/java/current/config-http.html#config-use-path-as-transaction-name configuration.
I tested it locally with same spring-boot and cloud versions.

@Junnyjun
Copy link
Author

This solved it, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-java community Issues and PRs created by the community triage
Projects
None yet
Development

No branches or pull requests

4 participants