Closed bmonteiro closed 3 years ago
@gernest could you take a look? Thanks
@bmonteiro can you please share a sample ApiDefinition
resource that will reproduce this issue?
apiVersion: tyk.tyk.io/v1alpha1
kind: ApiDefinition
metadata:
name: trevorblades
spec:
name: trevorblades
use_keyless: true
protocol: http
active: true
proxy:
target_url: https://countries.trevorblades.com
listen_path: /trevorblades
strip_listen_path: true
graphql:
enabled: true
execution_mode: proxyOnly
schema: |
directive @cacheControl(maxAge: Int, scope: CacheControlScope) on FIELD_DEFINITION | OBJECT | INTERFACE
enum CacheControlScope {
PUBLIC
PRIVATE
}
type Continent {
code: ID!
name: String!
countries: [Country!]!
}
input ContinentFilterInput {
code: StringQueryOperatorInput
}
type Country {
code: ID!
name: String!
native: String!
phone: String!
continent: Continent!
capital: String
currency: String
languages: [Language!]!
emoji: String!
emojiU: String!
states: [State!]!
}
input CountryFilterInput {
code: StringQueryOperatorInput
currency: StringQueryOperatorInput
continent: StringQueryOperatorInput
}
type Language {
code: ID!
name: String
native: String
rtl: Boolean!
}
input LanguageFilterInput {
code: StringQueryOperatorInput
}
type Query {
continents(filter: ContinentFilterInput): [Continent!]!
continent(code: ID!): Continent
countries(filter: CountryFilterInput): [Country!]!
country(code: ID!): Country
languages(filter: LanguageFilterInput): [Language!]!
language(code: ID!): Language
}
type State {
code: String
name: String!
country: Country!
}
input StringQueryOperatorInput {
eq: String
ne: String
in: [String]
nin: [String]
regex: String
glob: String
}
"""The `Upload` scalar type represents a file upload."""
scalar Upload
playground:
enabled: true
path: /playground
@gernest ^^
Thanks
@gernest, I also noticed that APIs added via the K8s Tyk Operator are not logging the requests in the Dashboard "API Usage Data - Log Browser". Pls let me know if it happens the same with you.
I also noticed that APIs added via the K8s Tyk Operator are not logging the requests in the Dashboard "API Usage Data - Log Browser". Pls let me know if it happens the same with you.
Could you try setting do_not_track: false
. This should explicitly turn on analytics recording. It's a bit confusing, apologies for this.
@bmonteiro I failed to reproduce this on latest master commit d39e3dd what version of the operator are you using?
{"level":"info","ts":1621885335.5927582,"logger":"apidefinition-resource","msg":"default","name":"trevorblades"}
{"level":"info","ts":1621885335.6020331,"logger":"apidefinition-resource","msg":"validate create","name":"trevorblades"}
{"level":"info","ts":1621885335.6233692,"logger":"controllers.ApiDefinition","msg":"Reconciling ApiDefinition instance","ApiDefinition":"default/trevorblades"}
{"level":"info","ts":1621885335.623463,"logger":"controllers.ApiDefinition","msg":"Updating linked policies"}
{"level":"info","ts":1621885335.6235962,"logger":"controllers.ApiDefinition","msg":"updating looping targets"}
{"level":"info","ts":1621885335.6954143,"logger":"controllers.ApiDefinition","msg":"Call","Method":"POST","URL":"http://dashboard-svc-pro-tyk-pro.tykpro-control-plane.svc.cluster.local:3000/api/apis","Status":200}
{"level":"info","ts":1621885335.7123349,"logger":"controllers.ApiDefinition","msg":"Call","Method":"GET","URL":"http://dashboard-svc-pro-tyk-pro.tykpro-control-plane.svc.cluster.local:3000/api/apis/60ac01972d60f9000191ff9b","Status":200}
{"level":"info","ts":1621885335.740829,"logger":"controllers.ApiDefinition","msg":"Call","Method":"PUT","URL":"http://dashboard-svc-pro-tyk-pro.tykpro-control-plane.svc.cluster.local:3000/api/apis/60ac01972d60f9000191ff9b","Status":200}
{"level":"info","ts":1621885335.7943926,"logger":"apidefinition-resource","msg":"default","name":"trevorblades"}
{"level":"info","ts":1621885335.8108892,"logger":"apidefinition-resource","msg":"validate update","name":"trevorblades"}
{"level":"info","ts":1621885335.8278265,"logger":"controllers.ApiDefinition","msg":"Completed reconciling ApiDefinition instance","ApiDefinition":"default/trevorblades"}
{"level":"info","ts":1621885335.8322914,"logger":"controllers.ApiDefinition","msg":"Reconciling ApiDefinition instance","ApiDefinition":"default/trevorblades"}
{"level":"info","ts":1621885335.832398,"logger":"controllers.ApiDefinition","msg":"Updating linked policies"}
{"level":"info","ts":1621885335.8324199,"logger":"controllers.ApiDefinition","msg":"updating looping targets"}
{"level":"info","ts":1621885335.8324826,"logger":"controllers.ApiDefinition","msg":"Updating ApiDefinition","ApiDefinition":"default/trevorblades"}
{"level":"info","ts":1621885335.847605,"logger":"controllers.ApiDefinition","msg":"Call","Method":"GET","URL":"http://dashboard-svc-pro-tyk-pro.tykpro-control-plane.svc.cluster.local:3000/api/apis","Status":200}
{"level":"info","ts":1621885335.8484218,"logger":"controllers.ApiDefinition","msg":"All api's","Count":1}
{"level":"info","ts":1621885335.8726113,"logger":"controllers.ApiDefinition","msg":"Call","Method":"PUT","URL":"http://dashboard-svc-pro-tyk-pro.tykpro-control-plane.svc.cluster.local:3000/api/apis/60ac01972d60f9000191ff9b","Status":200}
{"level":"info","ts":1621885335.8758144,"logger":"controllers.ApiDefinition","msg":"Completed reconciling ApiDefinition instance","ApiDefinition":"default/trevorblades"}
W0524 19:42:21.978601 1 warnings.go:70] networking.k8s.io/v1beta1 Ingress is deprecated in v1.19+, unavailable in v1.22+; use networking.k8s.io/v1 Ingress
@gernest I think it was 5233be6103c434f6a630a7cf95ec1d3ef9f2e807
Could you try setting
do_not_track: false
. This should explicitly turn on analytics recording. It's a bit confusing, apologies for this.
yep, but indeed it is confusing having the dashboard working in a different way. I would suggest to get both aligned.
Closing this since we failed to reproduce on master , feel free to reopen.
Hey @asoorm,
Please find below a full log when adding the trevorblades example from "Quickstart Examples-> GraphQL Proxy" (YAML) The API in visible (imported) in the Dashboard. Is this error in the log expected ? The API can be called but the Dashboard is missing logs (example: Log Browser) and a policy was configured/created. When created directly via the Dashboard (without using the tyk operator) the Log Browser shows logs.
Error:
I used the master version of the operator.
Full stack when adding the API: