标签:tag and jdb lis 查询条件 datetime use period param
ELB单维度
查询条件:
{"namespace":"SYS.ELB","dimensions":[{"lbaas_instance_id":["373b1e50-a1a5-4ca2-94a1-d8fde3787e50"]}],"resourceId":"373b1e50-a1a5-4ca2-94a1-d8fde3787e50","tenantId":"87262519899258880","start":1604016262495,"end":1609290262495,"period":86400,"statistics":"AVERAGE","projectId":"87648410807369728","metricName":"m1_cps"}
prometheus查询条件:
(avg_over_time(m1_cps{lbaas_instance_id=~"373b1e50-a1a5-4ca2-94a1-d8fde3787e50",lbaas_listener_id!~".+",projectId="87648410807369728",tenantId="87262519899258880"}[86400s]))
prometheus地址:
http://114.115.208.163:32713/api/v1/query_range?query={param}&start=1606694400&end=1609286400&step=86400s
clickhouse查询语句:
select max,min,sum,count,ts,tags from metrics.samples_aggregate where ts>=toDateTime(1604102400) and ts<=toDateTime(1606608000) and name=‘m1_cps‘ and arrayExists(x -> x IN (‘projectId=87648410807369728‘), tags) = 1 and arrayExists(x -> x IN (‘tenantId=87262519899258880‘), tags) = 1 and (arrayExists(x -> x IN (‘lbaas_instance_id=373b1e50-a1a5-4ca2-94a1-d8fde3787e50‘), tags) = 1) order by ts
结果:
[{"metric":{"accountId":"89452136085966848","cloudType":"1","lbaas_instance_id":"373b1e50-a1a5-4ca2-94a1-d8fde3787e50","tenantId":"87262519899258880","projectId":"87648410807369728"},"values":[["1604102400000","11.6"],["1604188800000","8.5"],["1604275200000","6.25"],["1604361600000","5.88"],["1604448000000","5.91"],["1604534400000","6.75"],["1604620800000","7.01"],["1604707200000","3.47"],["1604793600000","0.67"],["1604880000000","2.44"],["1604966400000","2.73"],["1605052800000","3.48"],["1605139200000","5.55"],["1605225600000","5.33"],["1605312000000","3.61"],["1605398400000","3.79"],["1605484800000","3.95"],["1605571200000","4.56"],["1605657600000","5.94"],["1605744000000","5.74"],["1605830400000","5.26"],["1605916800000","2.34"],["1606003200000","2.29"],["1606089600000","3.73"],["1606176000000","6.23"],["1606262400000","7.03"],["1606348800000","5.11"],["1606435200000","5.08"],["1606521600000","1.83"],["1606608000000","1.1"],["1606694400000","1.32"],["1606780800000","3.64"],["1606867200000","4.17"],["1606953600000","2.86"],["1607040000000","13.26"],["1607126400000","19.26"],["1607212800000","2.69"],["1607299200000","3.24"],["1607385600000","11.47"],["1607472000000","1.13"],["1607558400000","32.97"],["1607644800000","45.53"],["1607731200000","152.63"],["1607817600000","157.41"],["1607904000000","1.25"],["1607990400000","16.26"],["1608076800000","7.56"],["1608163200000","1.77"],["1608249600000","3.81"],["1608336000000","4.21"],["1608422400000","3.64"],["1608508800000","3.33"],["1608595200000","1.72"],["1608681600000","4.58"],["1608768000000","4.85"],["1608854400000","3.52"],["1608940800000","4.06"],["1609027200000","3.87"],["1609113600000","1.09"],["1609200000000","2.4"],["1609286400000","2.62"]]}]
监听器维度
查询条件:
{"namespace":"SYS.ELB","dimensions":[{"lbaas_instance_id":["373b1e50-a1a5-4ca2-94a1-d8fde3787e50"]},{"lbaas_listener_id":[]}],"resourceId":"373b1e50-a1a5-4ca2-94a1-d8fde3787e50","tenantId":"87262519899258880","start":1604016340637,"end":1609290340637,"period":86400,"statistics":"AVERAGE","projectId":"87648410807369728","metricName":"m1_cps"}
prometheus查询条件:
(avg_over_time(m1_cps{lbaas_listener_id=~".+",lbaas_instance_id=~"373b1e50-a1a5-4ca2-94a1-d8fde3787e50",projectId="87648410807369728",tenantId="87262519899258880"}[86400s]))
clickhouse查询语句:
select max,min,sum,count,ts,tags from metrics.samples_aggregate where ts>=toDateTime(1604102400) and ts<=toDateTime(1606608000) and name=‘m1_cps‘ and arrayExists(x -> x IN (‘projectId=87648410807369728‘), tags) = 1 and arrayExists(x -> x IN (‘tenantId=87262519899258880‘), tags) = 1 and (arrayExists(x -> x IN (‘lbaas_instance_id=373b1e50-a1a5-4ca2-94a1-d8fde3787e50‘), tags) = 1) order by ts
结果:
[{"metric":{"accountId":"89452136085966848","lbaas_listener_id":"18a5073d-023a-48b9-a7e9-fafbb146eb27","cloudType":"1","lbaas_instance_id":"373b1e50-a1a5-4ca2-94a1-d8fde3787e50","tenantId":"87262519899258880","projectId":"87648410807369728"},"values":[["1604102400000","0.04"],["1604188800000","0.05"],["1604275200000","0.01"],["1604361600000","0.03"],["1604448000000","0.03"],["1604534400000","0.06"],["1604620800000","0.1"],["1604707200000","0.02"],["1604793600000","0.02"],["1604880000000","0.05"],["1604966400000","0.01"],["1605052800000","0.02"],["1605139200000","0.01"],["1605225600000","0.03"],["1605312000000","0.01"],["1605398400000","0.03"],["1605484800000","0.04"],["1605571200000","0.03"],["1605657600000","0.01"],["1605744000000","0.02"],["1605830400000","0.07"],["1605916800000","0.02"],["1606003200000","0.01"],["1606089600000","0"],["1606176000000","0"],["1606262400000","0.02"],["1606348800000","0.01"],["1606435200000","0.06"],["1606521600000","0.01"],["1606608000000","0"],["1606694400000","0.03"],["1606780800000","0.01"],["1606867200000","0.05"],["1606953600000","0.03"],["1607040000000","0.05"],["1607126400000","0.02"],["1607212800000","0.01"],["1607299200000","0.02"],["1607385600000","0.01"],["1607472000000","0.01"],["1607558400000","0.02"],["1607644800000","0.07"],["1607731200000","0.01"],["1607817600000","0.01"],["1607904000000","0.03"],["1607990400000","0.01"],["1608076800000","0.01"],["1608163200000","0.01"],["1608249600000","0.01"],["1608336000000","0.01"],["1608422400000","0.02"],["1608508800000","0"],["1608595200000","0.01"],["1608681600000","0"],["1608768000000","0.01"],["1608854400000","0.01"],["1608940800000","0"],["1609027200000","0"],["1609113600000","0"],["1609200000000","0"],["1609286400000","0"]]},{"metric":{"accountId":"89452136085966848","lbaas_listener_id":"fba3e62f-8d4f-4a8e-96d6-1af1a6728d5b","cloudType":"1","lbaas_instance_id":"373b1e50-a1a5-4ca2-94a1-d8fde3787e50","tenantId":"87262519899258880","projectId":"87648410807369728"},"values":[["1604102400000","8.11"],["1604188800000","8.01"],["1604275200000","5.14"],["1604361600000","2.02"],["1604448000000","6.66"],["1604534400000","6.62"],["1604620800000","6.64"],["1604707200000","3.01"],["1604793600000","0.28"],["1604880000000","2.08"],["1604966400000","2.65"],["1605052800000","2.98"],["1605139200000","5.4"],["1605225600000","5.25"],["1605312000000","3.13"],["1605398400000","3.3"],["1605484800000","3.63"],["1605571200000","3.37"],["1605657600000","5.58"],["1605744000000","5.04"],["1605830400000","5.05"],["1605916800000","2.09"],["1606003200000","2.23"],["1606089600000","3.98"],["1606176000000","5.79"],["1606262400000","7.09"],["1606348800000","4.65"],["1606435200000","5.77"],["1606521600000","1.55"],["1606608000000","1"],["1606694400000","1.08"],["1606780800000","3.7"],["1606867200000","3.48"],["1606953600000","2.83"],["1607040000000","13.67"],["1607126400000","15.71"],["1607212800000","2.05"],["1607299200000","2.03"],["1607385600000","13.41"],["1607472000000","0.65"],["1607558400000","47.74"],["1607644800000","47.06"],["1607731200000","138.47"],["1607817600000","144.56"],["1607904000000","1.01"],["1607990400000","14.27"],["1608076800000","6.43"],["1608163200000","2.69"],["1608249600000","3.49"],["1608336000000","4.5"],["1608422400000","3.17"],["1608508800000","3.07"],["1608595200000","1.68"],["1608681600000","4.86"],["1608768000000","4.16"],["1608854400000","3.38"],["1608940800000","2.82"],["1609027200000","3.28"],["1609113600000","1.38"],["1609200000000","1.9"],["1609286400000","4"]]},{"metric":{"accountId":"89452136085966848","lbaas_listener_id":"ee8b921d-10b1-41af-81a4-3b9ed914ec1b","cloudType":"1","lbaas_instance_id":"373b1e50-a1a5-4ca2-94a1-d8fde3787e50","tenantId":"87262519899258880","projectId":"87648410807369728"},"values":[["1604102400000","0"],["1604188800000","0"],["1604275200000","0"],["1604361600000","0.01"],["1604448000000","0.01"],["1604534400000","0.01"],["1604620800000","0"],["1604707200000","0.01"],["1604793600000","0"],["1604880000000","0.04"],["1604966400000","0.01"],["1605052800000","0"],["1605139200000","0"],["1605225600000","0"],["1605312000000","0.01"],["1605398400000","0"],["1605484800000","0"],["1605571200000","0.01"],["1605657600000","0.01"],["1605744000000","0.04"],["1605830400000","0.02"],["1605916800000","0"],["1606003200000","0"],["1606089600000","0"],["1606176000000","0.01"],["1606262400000","0"],["1606348800000","0"],["1606435200000","0.01"],["1606521600000","0"],["1606608000000","0"],["1606694400000","0"],["1606780800000","0"],["1606867200000","0"],["1606953600000","0"],["1607040000000","0.01"],["1607126400000","0"],["1607212800000","0"],["1607299200000","0.01"],["1607385600000","0"],["1607472000000","0"],["1607558400000","0"],["1607644800000","0.01"],["1607731200000","0"],["1607817600000","0.01"],["1607904000000","0.01"],["1607990400000","0.02"],["1608076800000","0.01"],["1608163200000","0"],["1608249600000","0.01"],["1608336000000","0"],["1608422400000","0.01"],["1608508800000","0"],["1608595200000","0"],["1608681600000","0"],["1608768000000","0"],["1608854400000","0.01"],["1608940800000","0"],["1609027200000","0"],["1609113600000","0"],["1609200000000","0"],["1609286400000","0.07"]]},{"metric":{"accountId":"89452136085966848","lbaas_listener_id":"145a27d4-5133-4bb6-8c4d-8d54fdfd7cd9","cloudType":"1","lbaas_instance_id":"373b1e50-a1a5-4ca2-94a1-d8fde3787e50","tenantId":"87262519899258880","projectId":"87648410807369728"},"values":[["1604102400000","1.64"],["1604188800000","0.29"],["1604275200000","0.25"],["1604361600000","0.29"],["1604448000000","0.09"],["1604534400000","0.19"],["1604620800000","0.4"],["1604707200000","0.09"],["1604793600000","0.13"],["1604880000000","0.23"],["1604966400000","0.13"],["1605052800000","0.23"],["1605139200000","0.31"],["1605225600000","0.17"],["1605312000000","0.13"],["1605398400000","0.3"],["1605484800000","0.19"],["1605571200000","0.57"],["1605657600000","0.24"],["1605744000000","0.31"],["1605830400000","0.26"],["1605916800000","0.11"],["1606003200000","0.16"],["1606089600000","0.12"],["1606176000000","0.07"],["1606262400000","0.24"],["1606348800000","0.16"],["1606435200000","0.07"],["1606521600000","0.14"],["1606608000000","0"],["1606694400000","0.08"],["1606780800000","0.1"],["1606867200000","0.06"],["1606953600000","0.04"],["1607040000000","0.05"],["1607126400000","0.1"],["1607212800000","0.34"],["1607299200000","0.26"],["1607385600000","0.18"],["1607472000000","0.29"],["1607558400000","0.08"],["1607644800000","0.04"],["1607731200000","0.07"],["1607817600000","0.09"],["1607904000000","0.01"],["1607990400000","0.05"],["1608076800000","0.08"],["1608163200000","0.09"],["1608249600000","0.07"],["1608336000000","0.07"],["1608422400000","0.13"],["1608508800000","0.13"],["1608595200000","0.07"],["1608681600000","0.15"],["1608768000000","0.33"],["1608854400000","0.44"],["1608940800000","0.26"],["1609027200000","0.11"],["1609113600000","0.13"],["1609200000000","0.3"],["1609286400000","0.2"]]},{"metric":{"accountId":"89452136085966848","lbaas_listener_id":"199028af-6994-409a-95ae-a279190c74ca","cloudType":"1","lbaas_instance_id":"373b1e50-a1a5-4ca2-94a1-d8fde3787e50","tenantId":"87262519899258880","projectId":"87648410807369728"},"values":[["1604102400000","0.01"],["1604188800000","0"],["1604275200000","0.02"],["1604361600000","0.02"],["1604448000000","0.01"],["1604534400000","0.01"],["1604620800000","0.02"],["1604707200000","0"],["1604793600000","0"],["1604880000000","0.01"],["1604966400000","0.03"],["1605052800000","0.02"],["1605139200000","0.01"],["1605225600000","0.01"],["1605312000000","0"],["1605398400000","0.01"],["1605484800000","0.02"],["1605571200000","0.01"],["1605657600000","0.01"],["1605744000000","0"],["1605830400000","0.01"],["1605916800000","0"],["1606003200000","0"],["1606089600000","0.01"],["1606176000000","0"],["1606262400000","0"],["1606348800000","0.01"],["1606435200000","0.05"],["1606521600000","0.01"],["1606608000000","0"],["1606694400000","0.01"],["1606780800000","0"],["1606867200000","0.01"],["1606953600000","0.01"],["1607040000000","0.02"],["1607126400000","0.01"],["1607212800000","0.01"],["1607299200000","0.01"],["1607385600000","0"],["1607472000000","0"],["1607558400000","0"],["1607644800000","0.03"],["1607731200000","0.02"],["1607817600000","0.01"],["1607904000000","0.01"],["1607990400000","0"],["1608076800000","0.01"],["1608163200000","0"],["1608249600000","0.01"],["1608336000000","0.02"],["1608422400000","0.02"],["1608508800000","0"],["1608595200000","0"],["1608681600000","0.01"],["1608768000000","0.01"],["1608854400000","0"],["1608940800000","0.05"],["1609027200000","0"],["1609113600000","0.05"],["1609200000000","0"],["1609286400000","0"]]},{"metric":{"accountId":"89452136085966848","lbaas_listener_id":"5bd7867d-127d-4f55-8ac4-d924e1799692","cloudType":"1","lbaas_instance_id":"373b1e50-a1a5-4ca2-94a1-d8fde3787e50","tenantId":"87262519899258880","projectId":"87648410807369728"},"values":[["1604102400000","0"],["1604188800000","0"],["1604275200000","0"],["1604361600000","0"],["1604448000000","0"],["1604534400000","0"],["1604620800000","0"],["1604707200000","0"],["1604793600000","0"],["1604880000000","0"],["1604966400000","0"],["1605052800000","0"],["1605139200000","0"],["1605225600000","0"],["1605312000000","0"],["1605398400000","0"],["1605484800000","0"],["1605571200000","0"],["1605657600000","0"],["1605744000000","0"],["1605830400000","0"],["1605916800000","0"],["1606003200000","0"],["1606089600000","0"],["1606176000000","0"],["1606262400000","0"],["1606348800000","0"],["1606435200000","0"],["1606521600000","0"],["1606608000000","0"],["1606694400000","0"],["1606780800000","0"],["1606867200000","0"],["1606953600000","0"],["1607040000000","0"],["1607126400000","0"],["1607212800000","0"],["1607299200000","0"],["1607385600000","0"],["1607472000000","0"],["1607558400000","0"],["1607644800000","0"],["1607731200000","0"],["1607817600000","0"],["1607904000000","0"],["1607990400000","0"],["1608076800000","0"],["1608163200000","0"],["1608249600000","0"],["1608336000000","0"],["1608422400000","0"],["1608508800000","0"],["1608595200000","0"],["1608681600000","0"],["1608768000000","0"],["1608854400000","0"],["1608940800000","0"],["1609027200000","0"],["1609113600000","0"],["1609200000000","0"],["1609286400000","0"]]},{"metric":{"accountId":"89452136085966848","lbaas_listener_id":"4924a816-58df-4f3d-b324-6a4ccb0e8f63","cloudType":"1","lbaas_instance_id":"373b1e50-a1a5-4ca2-94a1-d8fde3787e50","tenantId":"87262519899258880","projectId":"87648410807369728"},"values":[["1604102400000","0.01"],["1604188800000","0.01"],["1604275200000","0.02"],["1604361600000","0.02"],["1604448000000","0.01"],["1604534400000","0"],["1604620800000","0.01"],["1604707200000","0"],["1604793600000","0.01"],["1604880000000","0.03"],["1604966400000","0"],["1605052800000","0"],["1605139200000","0"],["1605225600000","0.02"],["1605312000000","0.01"],["1605398400000","0.02"],["1605484800000","0"],["1605571200000","0.02"],["1605657600000","0"],["1605744000000","0.01"],["1605830400000","0"],["1605916800000","0"],["1606003200000","0.02"],["1606089600000","0"],["1606176000000","0"],["1606262400000","0"],["1606348800000","0.03"],["1606435200000","0.01"],["1606521600000","0"],["1606608000000","0"],["1606694400000","0"],["1606780800000","0.01"],["1606867200000","0.01"],["1606953600000","0.01"],["1607040000000","0.01"],["1607126400000","0.02"],["1607212800000","0.01"],["1607299200000","0.01"],["1607385600000","0.02"],["1607472000000","0.02"],["1607558400000","0.01"],["1607644800000","0"],["1607731200000","0"],["1607817600000","0.01"],["1607904000000","0.01"],["1607990400000","0"],["1608076800000","0.01"],["1608163200000","0"],["1608249600000","0"],["1608336000000","0"],["1608422400000","0"],["1608508800000","0.01"],["1608595200000","0.01"],["1608681600000","0.02"],["1608768000000","0.01"],["1608854400000","0.05"],["1608940800000","0"],["1609027200000","0"],["1609113600000","0"],["1609200000000","0"],["1609286400000","0"]]},{"metric":{"accountId":"89452136085966848","lbaas_listener_id":"c2cef751-72d2-4e31-b44d-613b5d94509e","cloudType":"1","lbaas_instance_id":"373b1e50-a1a5-4ca2-94a1-d8fde3787e50","tenantId":"87262519899258880","projectId":"87648410807369728"},"values":[["1604102400000","0"],["1604188800000","0"],["1604275200000","0"],["1604361600000","0"],["1604448000000","0"],["1604534400000","0"],["1604620800000","0"],["1604707200000","0"],["1604793600000","0"],["1604880000000","0"],["1604966400000","0"],["1605052800000","0"],["1605139200000","0"],["1605225600000","0"],["1605312000000","0"],["1605398400000","0"],["1605484800000","0"],["1605571200000","0"],["1605657600000","0"],["1605744000000","0"],["1605830400000","0"],["1605916800000","0"],["1606003200000","0"],["1606089600000","0"],["1606176000000","0"],["1606262400000","0"],["1606348800000","0"],["1606435200000","0"],["1606521600000","0"],["1606608000000","0"],["1606694400000","0"],["1606780800000","0"],["1606867200000","0"],["1606953600000","0"],["1607040000000","0"],["1607126400000","0"],["1607212800000","0"],["1607299200000","0"],["1607385600000","0"],["1607472000000","0"],["1607558400000","0"],["1607644800000","0"],["1607731200000","0"],["1607817600000","0"],["1607904000000","0"],["1607990400000","0"],["1608076800000","0"],["1608163200000","0"],["1608249600000","0"],["1608336000000","0"],["1608422400000","0"],["1608508800000","0"],["1608595200000","0"],["1608681600000","0"],["1608768000000","0"],["1608854400000","0"],["1608940800000","0"],["1609027200000","0"],["1609113600000","0"],["1609200000000","0"],["1609286400000","0"]]},{"metric":{"accountId":"89452136085966848","lbaas_listener_id":"194ef618-b81b-46ec-8fea-f2867cc00329","cloudType":"1","lbaas_instance_id":"373b1e50-a1a5-4ca2-94a1-d8fde3787e50","tenantId":"87262519899258880","projectId":"87648410807369728"},"values":[["1604102400000","0"],["1604188800000","0"],["1604275200000","0"],["1604361600000","0"],["1604448000000","0"],["1604534400000","0"],["1604620800000","0"],["1604707200000","0"],["1604793600000","0"],["1604880000000","0"],["1604966400000","0"],["1605052800000","0"],["1605139200000","0"],["1605225600000","0"],["1605312000000","0"],["1605398400000","0"],["1605484800000","0"],["1605571200000","0"],["1605657600000","0"],["1605744000000","0"],["1605830400000","0"],["1605916800000","0"],["1606003200000","0"],["1606089600000","0"],["1606176000000","0"],["1606262400000","0"],["1606348800000","0"],["1606435200000","0"],["1606521600000","0"],["1606608000000","0"],["1606694400000","0"],["1606780800000","0"],["1606867200000","0"],["1606953600000","0"],["1607040000000","0"],["1607126400000","0"],["1607212800000","0"],["1607299200000","0"],["1607385600000","0"],["1607472000000","0"],["1607558400000","0"],["1607644800000","0"],["1607731200000","0"],["1607817600000","0"],["1607904000000","0"],["1607990400000","0"],["1608076800000","0"],["1608163200000","0"],["1608249600000","0"],["1608336000000","0"],["1608422400000","0"],["1608508800000","0"],["1608595200000","0"],["1608681600000","0"],["1608768000000","0"],["1608854400000","0"],["1608940800000","0"],["1609027200000","0"],["1609113600000","0"],["1609200000000","0"],["1609286400000","0"]]},{"metric":{"accountId":"89452136085966848","lbaas_listener_id":"47599564-dab0-48aa-ae27-5289325503f4","cloudType":"1","lbaas_instance_id":"373b1e50-a1a5-4ca2-94a1-d8fde3787e50","tenantId":"87262519899258880","projectId":"87648410807369728"},"values":[["1604102400000","0"],["1604188800000","0"],["1604275200000","0"],["1604361600000","0"],["1604448000000","0"],["1604534400000","0.01"],["1604620800000","0"],["1604707200000","0"],["1604793600000","0"],["1604880000000","0"],["1604966400000","0"],["1605052800000","0"],["1605139200000","0"],["1605225600000","0"],["1605312000000","0"],["1605398400000","0"],["1605484800000","0"],["1605571200000","0"],["1605657600000","0"],["1605744000000","0"],["1605830400000","0.01"],["1605916800000","0"],["1606003200000","0"],["1606089600000","0"],["1606176000000","0"],["1606262400000","0"],["1606348800000","0.01"],["1606435200000","0"],["1606521600000","0"],["1606608000000","0"],["1606694400000","0"],["1606780800000","0"],["1606867200000","0.01"],["1606953600000","0"],["1607040000000","0"],["1607126400000","0"],["1607212800000","0"],["1607299200000","0"],["1607385600000","0"],["1607472000000","0"],["1607558400000","0"],["1607644800000","0"],["1607731200000","0"],["1607817600000","0.01"],["1607904000000","0"],["1607990400000","0"],["1608076800000","0.01"],["1608163200000","0"],["1608249600000","0"],["1608336000000","0"],["1608422400000","0"],["1608508800000","0"],["1608595200000","0"],["1608681600000","0"],["1608768000000","0"],["1608854400000","0"],["1608940800000","0"],["1609027200000","0"],["1609113600000","0"],["1609200000000","0"],["1609286400000","0"]]},{"metric":{"accountId":"89452136085966848","lbaas_listener_id":"a9a2bcce-e099-45fc-a692-d5639b8c6360","cloudType":"1","lbaas_instance_id":"373b1e50-a1a5-4ca2-94a1-d8fde3787e50","tenantId":"87262519899258880","projectId":"87648410807369728"},"values":[["1604102400000","0.11"],["1604188800000","0.2"],["1604275200000","0.21"],["1604361600000","0.14"],["1604448000000","0.14"],["1604534400000","0.15"],["1604620800000","0.31"],["1604707200000","0.15"],["1604793600000","0.13"],["1604880000000","0.17"],["1604966400000","0.1"],["1605052800000","0.2"],["1605139200000","0.17"],["1605225600000","0.15"],["1605312000000","0.15"],["1605398400000","0.27"],["1605484800000","0.18"],["1605571200000","0.1"],["1605657600000","0.23"],["1605744000000","0.24"],["1605830400000","0.27"],["1605916800000","0.07"],["1606003200000","0.1"],["1606089600000","0.19"],["1606176000000","0.13"],["1606262400000","0.19"],["1606348800000","0.14"],["1606435200000","0.02"],["1606521600000","0.14"],["1606608000000","0"],["1606694400000","0.23"],["1606780800000","0.08"],["1606867200000","0.04"],["1606953600000","0.04"],["1607040000000","0.06"],["1607126400000","0.03"],["1607212800000","0.05"],["1607299200000","0.11"],["1607385600000","0.21"],["1607472000000","0.14"],["1607558400000","0.07"],["1607644800000","0.05"],["1607731200000","0.09"],["1607817600000","0.14"],["1607904000000","0.02"],["1607990400000","0.05"],["1608076800000","0.06"],["1608163200000","0.06"],["1608249600000","0.09"],["1608336000000","0.04"],["1608422400000","0.21"],["1608508800000","0.07"],["1608595200000","0.07"],["1608681600000","0.14"],["1608768000000","0.23"],["1608854400000","0.35"],["1608940800000","0.11"],["1609027200000","0"],["1609113600000","0.2"],["1609200000000","0.07"],["1609286400000","0.29"]]},{"metric":{"accountId":"89452136085966848","lbaas_listener_id":"3a2aceda-29c5-4301-b01e-33c133ba3567","cloudType":"1","lbaas_instance_id":"373b1e50-a1a5-4ca2-94a1-d8fde3787e50","tenantId":"87262519899258880","projectId":"87648410807369728"},"values":[["1604102400000","0.02"],["1604188800000","0.01"],["1604275200000","0.08"],["1604361600000","0.03"],["1604448000000","0"],["1604534400000","0.03"],["1604620800000","0.01"],["1604707200000","0.07"],["1604793600000","0"],["1604880000000","0.01"],["1604966400000","0.04"],["1605052800000","0.07"],["1605139200000","0.06"],["1605225600000","0.04"],["1605312000000","0"],["1605398400000","0.02"],["1605484800000","0.06"],["1605571200000","0.01"],["1605657600000","0.04"],["1605744000000","0.01"],["1605830400000","0.01"],["1605916800000","0"],["1606003200000","0.01"],["1606089600000","0.2"],["1606176000000","0.01"],["1606262400000","0.05"],["1606348800000","0.02"],["1606435200000","0.04"],["1606521600000","0"],["1606608000000","0"],["1606694400000","0"],["1606780800000","0.01"],["1606867200000","0.01"],["1606953600000","0.02"],["1607040000000","0.03"],["1607126400000","0.02"],["1607212800000","0"],["1607299200000","0"],["1607385600000","0.02"],["1607472000000","0.01"],["1607558400000","0"],["1607644800000","0.06"],["1607731200000","0.01"],["1607817600000","0"],["1607904000000","0.01"],["1607990400000","0.03"],["1608076800000","0.05"],["1608163200000","0.01"],["1608249600000","0.01"],["1608336000000","0.02"],["1608422400000","0"],["1608508800000","0"],["1608595200000","0"],["1608681600000","0.19"],["1608768000000","0.01"],["1608854400000","0.01"],["1608940800000","0"],["1609027200000","0"],["1609113600000","0"],["1609200000000","0"],["1609286400000","0"]]}]
选择一个监听器
查询条件:
{"namespace":"SYS.ELB","dimensions":[{"lbaas_instance_id":["373b1e50-a1a5-4ca2-94a1-d8fde3787e50"]},{"lbaas_listener_id":["c2cef751-72d2-4e31-b44d-613b5d94509e"]}],"resourceId":"373b1e50-a1a5-4ca2-94a1-d8fde3787e50","tenantId":"87262519899258880","start":1604016340637,"end":1609290340637,"period":86400,"statistics":"AVERAGE","projectId":"87648410807369728","metricName":"m1_cps"}
prometheus查询条件:
(avg_over_time(m1_cps{lbaas_listener_id=~"c2cef751-72d2-4e31-b44d-613b5d94509e",lbaas_instance_id=~"373b1e50-a1a5-4ca2-94a1-d8fde3787e50",projectId="87648410807369728",tenantId="87262519899258880"}[86400s]))
clickhouse查询语句:
select max,min,sum,count,ts,tags from metrics.samples_aggregate where ts>=toDateTime(1604102400) and ts<=toDateTime(1606608000) and name=‘m1_cps‘ and arrayExists(x -> x IN (‘projectId=87648410807369728‘), tags) = 1 and arrayExists(x -> x IN (‘tenantId=87262519899258880‘), tags) = 1 and (arrayExists(x -> x IN (‘lbaas_listener_id=c2cef751-72d2-4e31-b44d-613b5d94509e‘), tags) = 1 and arrayExists(x -> x IN (‘lbaas_instance_id=373b1e50-a1a5-4ca2-94a1-d8fde3787e50‘), tags) = 1) order by ts
结果:
[{"metric":{"accountId":"89452136085966848","lbaas_listener_id":"c2cef751-72d2-4e31-b44d-613b5d94509e","cloudType":"1","lbaas_instance_id":"373b1e50-a1a5-4ca2-94a1-d8fde3787e50","tenantId":"87262519899258880","projectId":"87648410807369728"},"values":[["1604102400000","0"],["1604188800000","0"],["1604275200000","0"],["1604361600000","0"],["1604448000000","0"],["1604534400000","0"],["1604620800000","0"],["1604707200000","0"],["1604793600000","0"],["1604880000000","0"],["1604966400000","0"],["1605052800000","0"],["1605139200000","0"],["1605225600000","0"],["1605312000000","0"],["1605398400000","0"],["1605484800000","0"],["1605571200000","0"],["1605657600000","0"],["1605744000000","0"],["1605830400000","0"],["1605916800000","0"],["1606003200000","0"],["1606089600000","0"],["1606176000000","0"],["1606262400000","0"],["1606348800000","0"],["1606435200000","0"],["1606521600000","0"],["1606608000000","0"],["1606694400000","0"],["1606780800000","0"],["1606867200000","0"],["1606953600000","0"],["1607040000000","0"],["1607126400000","0"],["1607212800000","0"],["1607299200000","0"],["1607385600000","0"],["1607472000000","0"],["1607558400000","0"],["1607644800000","0"],["1607731200000","0"],["1607817600000","0"],["1607904000000","0"],["1607990400000","0"],["1608076800000","0"],["1608163200000","0"],["1608249600000","0"],["1608336000000","0"],["1608422400000","0"],["1608508800000","0"],["1608595200000","0"],["1608681600000","0"],["1608768000000","0"],["1608854400000","0"],["1608940800000","0"],["1609027200000","0"],["1609113600000","0"],["1609200000000","0"],["1609286400000","0"]]}]
"jdbc:clickhouse://117.78.43.201:32710"
标签:tag and jdb lis 查询条件 datetime use period param
原文地址:https://www.cnblogs.com/yaoyu1983/p/14210040.html