i)?-1:1})):e}),[h,t,s,u,o]),v=(0,r.useMemo)((()=>f.some((e=>e.copyValue))),[f]),g=e=>()=>{(e=>{d((t=>"asc"===t&&s===e?"desc":"asc")),c(e)})(e)};return f.length?Et("div",{className:wr()({"vm-table-view":!0,"vm-table-view_mobile":i}),children:Et("table",{className:"vm-table",ref:l,children:[Et("thead",{className:"vm-table-header",children:Et("tr",{className:"vm-table__row vm-table__row_header",children:[h.map(((e,t)=>Et("td",{className:"vm-table-cell vm-table-cell_header vm-table-cell_sort",onClick:g(e.key),children:Et("div",{className:"vm-table-cell__content",children:[e.key,Et("div",{className:wr()({"vm-table__sort-icon":!0,"vm-table__sort-icon_active":s===e.key,"vm-table__sort-icon_desc":"desc"===u&&s===e.key}),children:Et(jn,{})})]})},t))),Et("td",{className:"vm-table-cell vm-table-cell_header vm-table-cell_right vm-table-cell_sort",onClick:g("Value"),children:Et("div",{className:"vm-table-cell__content",children:[Et("div",{className:wr()({"vm-table__sort-icon":!0,"vm-table__sort-icon_active":"Value"===s,"vm-table__sort-icon_desc":"desc"===u}),children:Et(jn,{})}),"Value"]})}),v&&Et("td",{className:"vm-table-cell vm-table-cell_header"})]})}),Et("tbody",{className:"vm-table-body",children:f.map(((e,t)=>{return Et("tr",{className:"vm-table__row",children:[e.metadata.map(((e,n)=>Et("td",{className:wr()({"vm-table-cell vm-table-cell_no-wrap":!0,"vm-table-cell_gray":f[t-1]&&f[t-1].metadata[n]===e}),children:e},n))),Et("td",{className:"vm-table-cell vm-table-cell_right vm-table-cell_no-wrap",children:e.values.length?e.values.map((e=>Et("p",{children:e},e))):e.value}),v&&Et("td",{className:"vm-table-cell vm-table-cell_right",children:e.copyValue&&Et("div",{className:"vm-table-cell__content",children:Et(da,{title:"Copy row",children:Et(ea,{variant:"text",color:"gray",size:"small",startIcon:Et(nr,{}),onClick:(n=e.copyValue,async()=>{await a(n,"Row has been copied")}),ariaLabel:"copy row"})})})})]},t);var n}))})]})}):Et(qr,{variant:"warning",children:"No data to show"})},yh=e=>{let{checked:t=!1,disabled:n=!1,label:r,color:a="secondary",onChange:i}=e;return Et("div",{className:wr()({"vm-checkbox":!0,"vm-checkbox_disabled":n,"vm-checkbox_active":t,["vm-checkbox_".concat(a,"_active")]:t,["vm-checkbox_".concat(a)]:a}),onClick:()=>{n||i(!t)},children:[Et("div",{className:"vm-checkbox-track",children:Et("div",{className:"vm-checkbox-track__thumb",children:Et(Jn,{})})}),r&&Et("span",{className:"vm-checkbox__label",children:r})]})},_h="Table settings",bh=e=>{let{columns:t,defaultColumns:n=[],tableCompact:a,onChangeColumns:i,toggleTableCompact:o}=e;const{isMobile:l}=Ur(),s=(0,r.useRef)(null),{value:c,toggle:u,setFalse:d}=na(!1),h=(0,r.useMemo)((()=>!t.length),[t]),m=e=>()=>{(e=>{i(n.includes(e)?n.filter((t=>t!==e)):[...n,e])})(e)};return(0,r.useEffect)((()=>{zo(t,n)||i(t)}),[t]),Et("div",{className:"vm-table-settings",children:[Et(da,{title:_h,children:Et("div",{ref:s,children:Et(ea,{variant:"text",startIcon:Et(Tn,{}),onClick:u,disabled:h,ariaLabel:"table settings"})})}),Et(ta,{open:c,onClose:d,placement:"bottom-right",buttonRef:s,title:_h,children:Et("div",{className:wr()({"vm-table-settings-popper":!0,"vm-table-settings-popper_mobile":l}),children:[Et("div",{className:"vm-table-settings-popper-list vm-table-settings-popper-list_first",children:Et(Io,{label:"Compact view",value:a,onChange:o})}),Et("div",{className:"vm-table-settings-popper-list",children:[Et("div",{className:"vm-table-settings-popper-list-header",children:[Et("h3",{className:"vm-table-settings-popper-list-header__title",children:"Display columns"}),Et(da,{title:"Reset to default",children:Et(ea,{color:"primary",variant:"text",size:"small",onClick:()=>{d(),i(t)},startIcon:Et(Pn,{}),ariaLabel:"reset columns"})})]}),t.map((e=>Et("div",{className:"vm-table-settings-popper-list__item",children:Et(yh,{checked:n.includes(e),onChange:m(e),label:e,disabled:a})},e)))]})]})})]})},wh=e=>{let{liveData:t,controlsRef:n}=e;const{tableCompact:a}=Ir(),i=Rr(),[o,l]=(0,r.useState)(),s=(0,r.useMemo)((()=>fh(t||[]).map((e=>e.key))),[t]),c=Et(bh,{columns:s,defaultColumns:o,onChangeColumns:l,tableCompact:a,toggleTableCompact:()=>{i({type:"TOGGLE_TABLE_COMPACT"})}});return Et(St.FK,{children:[n.current&&(0,r.createPortal)(c,n.current),Et(gh,{data:t,displayColumns:o})]})},kh=e=>{let{graphData:t,liveData:n,isHistogram:r,displayType:a,controlsRef:i}=e;return a===ht.code&&n?Et(ph,{data:n}):a===ht.table&&n?Et(wh,{liveData:n,controlsRef:i}):a===ht.chart&&t?Et(mh,{graphData:t,isHistogram:r,controlsRef:i}):null},xh=[Et(St.FK,{children:[Et("p",{children:"Filename - specify the name for your report file."}),Et("p",{children:["Default format: ",Et("code",{children:["vmui_report_$",Rt,".json"]}),"."]}),Et("p",{children:"This name will be used when saving your report on your device."})]}),Et(St.FK,{children:[Et("p",{children:"Comment (optional) - add a comment to your report."}),Et("p",{children:"This can be any additional information that will be useful when reviewing the report later."})]}),Et(St.FK,{children:[Et("p",{children:"Query trace - enable this option to include a query trace in your report."}),Et("p",{children:"This will assist in analyzing and diagnosing the query processing."})]}),Et(St.FK,{children:[Et("p",{children:"Generate Report - click this button to generate and save your report. "}),Et("p",{children:["After creation, the report can be downloaded and examined on the ",Et(Ie,{to:Ye.queryAnalyzer,target:"_blank",rel:"noreferrer",className:"vm-link vm-link_underlined",children:qe[Ye.queryAnalyzer].title})," page."]})]})],Sh=()=>"vmui_report_".concat(i()().utc().format(Rt)),Ch=e=>{let{fetchUrl:t}=e;const{query:n}=Sn(),[a,i]=(0,r.useState)(Sh()),[o,l]=(0,r.useState)(""),[s,c]=(0,r.useState)(!0),[u,d]=(0,r.useState)(),[h,m]=(0,r.useState)(!1),p=(0,r.useRef)(null),f=(0,r.useRef)(null),v=(0,r.useRef)(null),g=(0,r.useRef)(null),y=[p,f,v,g],[_,b]=(0,r.useState)(0),{value:w,toggle:k,setFalse:x}=na(!1),{value:S,toggle:C,setFalse:E}=na(!1),N=(0,r.useMemo)((()=>{if(t)return t.map(((e,t)=>{const n=new URL(e);return s?n.searchParams.set("trace","1"):n.searchParams.delete("trace"),{id:t,url:n}}))}),[t,s]),A=(0,r.useCallback)((e=>{const t=JSON.stringify(e,null,2),n=new Blob([t],{type:"application/json"}),r=URL.createObjectURL(n),i=document.createElement("a");i.href=r,i.download="".concat(a||Sh(),".json"),document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r),x()}),[a]),M=(0,r.useCallback)((async()=>{if(N){d(""),m(!0);try{const e=[];for await(const{url:t,id:n}of N){const r=await fetch(t),a=await r.json();if(r.ok)a.vmui={id:n,comment:o,params:rt().parse(new URL(t).search.replace(/^\?/,""))},e.push(a);else{const e=a.errorType?"".concat(a.errorType,"\r\n"):"";d("".concat(e).concat((null===a||void 0===a?void 0:a.error)||(null===a||void 0===a?void 0:a.message)||"unknown error"))}}e.length&&A(e)}catch(ep){ep instanceof Error&&"AbortError"!==ep.name&&d("".concat(ep.name,": ").concat(ep.message))}finally{m(!1)}}else d(mt.validQuery)}),[N,o,A,n]),T=e=>()=>{b((t=>t+e))};return(0,r.useEffect)((()=>{d(""),i(Sh()),l("")}),[w]),(0,r.useEffect)((()=>{b(0)}),[S]),Et(St.FK,{children:[Et(da,{title:"Export query",children:Et(ea,{variant:"text",startIcon:Et(_r,{}),onClick:k,ariaLabel:"export query"})}),w&&Et(ua,{title:"Export query",onClose:x,isOpen:w,children:Et("div",{className:"vm-download-report",children:[Et("div",{className:"vm-download-report-settings",children:[Et("div",{ref:p,children:Et(Da,{label:"Filename",value:a,onChange:i})}),Et("div",{ref:f,children:Et(Da,{type:"textarea",label:"Comment",value:o,onChange:l})}),Et("div",{ref:v,children:Et(yh,{checked:s,onChange:c,label:"Include query trace"})})]}),u&&Et(qr,{variant:"error",children:u}),Et("div",{className:"vm-download-report__buttons",children:[Et(ea,{variant:"text",onClick:C,children:"Help"}),Et("div",{ref:g,children:Et(ea,{onClick:M,disabled:h,children:h?"Loading data...":"Generate Report"})})]}),Et(ta,{open:S,buttonRef:y[_],placement:"top-left",variant:"dark",onClose:E,children:Et("div",{className:"vm-download-report-helper",children:[Et("div",{className:"vm-download-report-helper__description",children:xh[_]}),Et("div",{className:"vm-download-report-helper__buttons",children:[0!==_&&Et(ea,{onClick:T(-1),size:"small",color:"white",children:"Prev"}),Et(ea,{onClick:_===y.length-1?E:T(1),size:"small",color:"white",variant:"text",children:_===y.length-1?"Close":"Next"})]})]})})]})})]})},Eh=()=>{el();const{isMobile:e}=Ur(),{displayType:t}=Ir(),{query:n}=Sn(),{customStep:a}=jr(),i=Hr(),[o,l]=(0,r.useState)([]),[s,c]=(0,r.useState)(!n[0]),[u,d]=(0,r.useState)(!1),h=(0,r.useRef)(null),{fetchUrl:m,isLoading:p,liveData:f,graphData:v,error:g,queryErrors:y,setQueryErrors:_,queryStats:b,warning:w,traces:k,isHistogram:x}=Xo({visible:!0,customStep:a,hideQuery:o,showAllSeries:u}),S=!(null!==f&&void 0!==f&&f.length)&&t!==ht.chart,C=!s&&g;return(0,r.useEffect)((()=>{i({type:"SET_IS_HISTOGRAM",payload:x})}),[v]),Et("div",{className:wr()({"vm-custom-panel":!0,"vm-custom-panel_mobile":e}),children:[Et(Yo,{queryErrors:s?[]:y,setQueryErrors:_,setHideError:c,stats:b,onHideQuery:e=>{l(e)},onRunQuery:()=>{c(!1)}}),Et(ul,{traces:k,displayType:t}),p&&Et(Bo,{}),C&&Et(qr,{variant:"error",children:g}),S&&Et(qr,{variant:"info",children:Et(al,{})}),w&&Et(dl,{warning:w,query:n,onChange:d}),Et("div",{className:wr()({"vm-custom-panel-body":!0,"vm-custom-panel-body_mobile":e,"vm-block":!0,"vm-block_mobile":e}),children:[Et("div",{className:"vm-custom-panel-body-header",ref:h,children:[Et("div",{className:"vm-custom-panel-body-header__tabs",children:Et(Ar,{})}),(v||f)&&Et(Ch,{fetchUrl:m})]}),Et(kh,{graphData:v,liveData:f,isHistogram:x,displayType:t,controlsRef:h})]})]})},Nh=e=>{let{title:t,description:n,unit:a,expr:i,showLegend:o,filename:l,alias:s}=e;const{isMobile:c}=Ur(),{period:u}=pn(),{customStep:d}=jr(),h=fn(),m=(0,r.useRef)(null),[p,f]=(0,r.useState)(!1),[v,g]=(0,r.useState)(!1),[y,_]=(0,r.useState)({limits:{enable:!1,range:{1:[0,0]}}}),b=(0,r.useMemo)((()=>Array.isArray(i)&&i.every((e=>e))),[i]),{isLoading:w,graphData:k,error:x,warning:S}=Xo({predefinedQuery:b?i:[],display:ht.chart,visible:p,customStep:d}),C=e=>{const t={...y};t.limits.range=e,_(t)};if((0,r.useEffect)((()=>{const e=new IntersectionObserver((e=>{e.forEach((e=>f(e.isIntersecting)))}),{threshold:.1});return m.current&&e.observe(m.current),()=>{m.current&&e.unobserve(m.current)}}),[m]),!b)return Et(qr,{variant:"error",children:[Et("code",{children:'"expr"'})," not found. Check the configuration file ",Et("b",{children:l}),"."]});const E=()=>Et("div",{className:"vm-predefined-panel-header__description vm-default-styles",children:[n&&Et(St.FK,{children:[Et("div",{children:[Et("span",{children:"Description:"}),Et("div",{dangerouslySetInnerHTML:{__html:Co.parse(n)}})]}),Et("hr",{})]}),Et("div",{children:[Et("span",{children:"Queries:"}),Et("div",{children:i.map(((e,t)=>Et("div",{children:e},"".concat(t,"_").concat(e))))})]})]});return Et("div",{className:"vm-predefined-panel",ref:m,children:[Et("div",{className:"vm-predefined-panel-header",children:[Et(da,{title:Et(E,{}),children:Et("div",{className:"vm-predefined-panel-header__info",children:Et(On,{})})}),Et("h3",{className:"vm-predefined-panel-header__title",children:t||""}),Et(hh,{yaxis:y,setYaxisLimits:C,toggleEnableLimits:()=>{const e={...y};e.limits.enable=!e.limits.enable,_(e)},spanGaps:{value:v,onChange:g}})]}),Et("div",{className:"vm-predefined-panel-body",children:[w&&Et(Bo,{}),x&&Et(qr,{variant:"error",children:x}),S&&Et(qr,{variant:"warning",children:S}),k&&Et(sh,{data:k,period:u,customStep:d,query:i,yaxis:y,unit:a,alias:s,showLegend:o,setYaxisLimits:C,setPeriod:e=>{let{from:t,to:n}=e;h({type:"SET_PERIOD",payload:{from:t,to:n}})},fullWidth:!1,height:c?.5*window.innerHeight:500,spanGaps:v})]})]})},Ah=e=>{let{index:t,title:n,panels:a,filename:i}=e;const o=Cr(),l=(0,r.useMemo)((()=>o.width/12),[o]),[s,c]=(0,r.useState)(!t),[u,d]=(0,r.useState)([]);(0,r.useEffect)((()=>{d(a&&a.map((e=>e.width||12)))}),[a]);const[h,m]=(0,r.useState)({start:0,target:0,enable:!1}),p=(0,r.useCallback)((e=>{if(!h.enable)return;const{start:t}=h,n=Math.ceil((t-e.clientX)/l);if(Math.abs(n)>=12)return;const r=u.map(((e,t)=>e-(t===h.target?n:0)));d(r)}),[h,l]),f=(0,r.useCallback)((()=>{m({...h,enable:!1})}),[h]),v=e=>t=>{((e,t)=>{m({start:e.clientX,target:t,enable:!0})})(t,e)};Sr("mousemove",p),Sr("mouseup",f);return Et("div",{className:"vm-predefined-dashboard",children:Et(ci,{defaultExpanded:s,onChange:e=>c(e),title:Et((()=>Et("div",{className:wr()({"vm-predefined-dashboard-header":!0,"vm-predefined-dashboard-header_open":s}),children:[(n||i)&&Et("span",{className:"vm-predefined-dashboard-header__title",children:n||"".concat(t+1,". ").concat(i)}),a&&Et("span",{className:"vm-predefined-dashboard-header__count",children:["(",a.length," panels)"]})]})),{}),children:Et("div",{className:"vm-predefined-dashboard-panels",children:Array.isArray(a)&&a.length?a.map(((e,t)=>Et("div",{className:"vm-predefined-dashboard-panels-panel vm-block vm-block_empty-padding",style:{gridColumn:"span ".concat(u[t])},children:[Et(Nh,{title:e.title,description:e.description,unit:e.unit,expr:e.expr,alias:e.alias,filename:i,showLegend:e.showLegend}),Et("button",{className:"vm-predefined-dashboard-panels-panel__resizer",onMouseDown:v(t),"aria-label":"resize the panel"})]},t))):Et("div",{className:"vm-predefined-dashboard-panels-panel__alert",children:Et(qr,{variant:"error",children:[Et("code",{children:'"panels"'})," not found. Check the configuration file ",Et("b",{children:i}),"."]})})})})})};function Mh(e){return function(e,t){return Object.fromEntries(Object.entries(e).filter(t))}(e,(e=>!!e[1]||"number"===typeof e[1]))}const Th=()=>{(()=>{const{duration:e,relativeTime:t,period:{date:n}}=pn(),{customStep:a}=jr(),{setSearchParamsFromKeys:i}=ei(),o=()=>{const r=Mh({"g0.range_input":e,"g0.end_input":n,"g0.step_input":a,"g0.relative_time":t});i(r)};(0,r.useEffect)(o,[e,t,n,a]),(0,r.useEffect)(o,[])})();const{isMobile:e}=Ur(),{dashboardsSettings:t,dashboardsLoading:n,dashboardsError:a}=Zr(),[i,o]=(0,r.useState)(0),l=(0,r.useMemo)((()=>t.map(((e,t)=>({label:e.title||"",value:t})))),[t]),s=(0,r.useMemo)((()=>t[i]||{}),[t,i]),c=(0,r.useMemo)((()=>null===s||void 0===s?void 0:s.rows),[s]),u=(0,r.useMemo)((()=>s.title||s.filename||""),[s]),d=(0,r.useMemo)((()=>Array.isArray(c)&&!!c.length),[c]),h=e=>()=>{(e=>{o(e)})(e)};return Et("div",{className:"vm-predefined-panels",children:[n&&Et(Bo,{}),!t.length&&a&&Et(qr,{variant:"error",children:a}),!t.length&&Et(qr,{variant:"info",children:"Dashboards not found"}),l.length>1&&Et("div",{className:wr()({"vm-predefined-panels-tabs":!0,"vm-predefined-panels-tabs_mobile":e}),children:l.map((e=>Et("div",{className:wr()({"vm-predefined-panels-tabs__tab":!0,"vm-predefined-panels-tabs__tab_active":e.value==i}),onClick:h(e.value),children:e.label},e.value)))}),Et("div",{className:"vm-predefined-panels__dashboards",children:[d&&c.map(((e,t)=>Et(Ah,{index:t,filename:u,title:e.title,panels:e.panels},"".concat(i,"_").concat(t)))),!!t.length&&!d&&Et(qr,{variant:"error",children:[Et("code",{children:'"rows"'})," not found. Check the configuration file ",Et("b",{children:u}),"."]})]})]})},Lh=(e,t)=>{const n=t.match?"&match[]="+encodeURIComponent(t.match):"",r=t.focusLabel?"&focusLabel="+encodeURIComponent(t.focusLabel):"";return"".concat(e,"/api/v1/status/tsdb?topN=").concat(t.topN,"&date=").concat(t.date).concat(n).concat(r)};class Ph{constructor(){this.tsdbStatus=void 0,this.tabsNames=void 0,this.isPrometheus=void 0,this.tsdbStatus=this.defaultTSDBStatus,this.tabsNames=["table","graph"],this.isPrometheus=!1,this.getDefaultState=this.getDefaultState.bind(this)}set tsdbStatusData(e){this.isPrometheus=!(null===e||void 0===e||!e.headStats),this.tsdbStatus=e}get tsdbStatusData(){return this.tsdbStatus}get defaultTSDBStatus(){return{totalSeries:0,totalSeriesPrev:0,totalSeriesByAll:0,totalLabelValuePairs:0,seriesCountByMetricName:[],seriesCountByLabelName:[],seriesCountByFocusLabelValue:[],seriesCountByLabelValuePair:[],labelValueCountByLabelName:[]}}get isPrometheusData(){return this.isPrometheus}keys(e,t){const n=e&&/__name__=".+"/.test(e),r=e&&/{.+=".+"}/g.test(e),a=e&&/__name__=".+", .+!=""/g.test(e);let i=[];return i=t||a?i.concat("seriesCountByFocusLabelValue"):n?i.concat("labelValueCountByLabelName"):r?i.concat("seriesCountByMetricName","seriesCountByLabelName"):i.concat("seriesCountByMetricName","seriesCountByLabelName","seriesCountByLabelValuePair","labelValueCountByLabelName"),i}getDefaultState(e,t){return this.keys(e,t).reduce(((e,t)=>({...e,tabs:{...e.tabs,[t]:this.tabsNames},containerRefs:{...e.containerRefs,[t]:(0,r.useRef)(null)}})),{tabs:{},containerRefs:{}})}sectionsTitles(e){return{seriesCountByMetricName:"Metric names with the highest number of series",seriesCountByLabelName:"Labels with the highest number of series",seriesCountByFocusLabelValue:'Values for "'.concat(e,'" label with the highest number of series'),seriesCountByLabelValuePair:"Label=value pairs with the highest number of series",labelValueCountByLabelName:"Labels with the highest number of unique values"}}get sectionsTips(){return{seriesCountByMetricName:"\n \n This table returns a list of metrics with the highest cardinality.\n The cardinality of a metric is the number of time series associated with that metric,\n where each time series is defined as a unique combination of key-value label pairs.\n
\n \n When looking to reduce the number of active series in your data source,\n you can start by inspecting individual metrics with high cardinality\n (i.e. that have lots of active time series associated with them),\n since that single metric contributes a large fraction of the series that make up your total series count.\n
",seriesCountByLabelName:"\n \n This table returns a list of the labels with the highest number of series.\n
\n \n Use this table to identify labels that are storing dimensions with high cardinality\n (many different label values).\n
\n \n It is recommended to choose labels such that they have a finite set of values,\n since every unique combination of key-value label pairs creates a new time series\n and therefore can dramatically increase the number of time series in your system.\n
",seriesCountByFocusLabelValue:"\n \n This table returns a list of unique label values per selected label.\n
\n \n Use this table to identify label values that are storing per each selected series.\n
",labelValueCountByLabelName:"\n \n This table returns a list of labels with the highest number of the unique values.\n
\n ",seriesCountByLabelValuePair:"\n \n This table returns a list of the label values pairs with the highest number of series.\n
\n \n Use this table to identify unique label values pairs. This helps to identify same labels \n is applied to count timeseries in your system, since every unique combination of key-value label pairs \n creates a new time series and therefore can dramatically increase the number of time series in your system\n
"}}get tablesHeaders(){return{seriesCountByMetricName:Oh,seriesCountByLabelName:Ih,seriesCountByFocusLabelValue:Rh,seriesCountByLabelValuePair:Dh,labelValueCountByLabelName:zh}}totalSeries(e){return"labelValueCountByLabelName"===e?-1:arguments.length>1&&void 0!==arguments[1]&&arguments[1]?this.tsdbStatus.totalSeriesPrev:this.tsdbStatus.totalSeries}}const Oh=[{id:"name",label:"Metric name"},{id:"value",label:"Number of series"},{id:"percentage",label:"Share in total",info:"Shows the share of a metric to the total number of series"},{id:"action",label:""}],Ih=[{id:"name",label:"Label name"},{id:"value",label:"Number of series"},{id:"percentage",label:"Share in total",info:"Shows the share of the label to the total number of series"},{id:"action",label:""}],Rh=[{id:"name",label:"Label value"},{id:"value",label:"Number of series"},{id:"percentage",label:"Share in total"},{disablePadding:!1,id:"action",label:"",numeric:!1}],Dh=[{id:"name",label:"Label=value pair"},{id:"value",label:"Number of series"},{id:"percentage",label:"Share in total",info:"Shows the share of the label value pair to the total number of series"},{id:"action",label:""}],zh=[{id:"name",label:"Label name"},{id:"value",label:"Number of unique values"},{id:"action",label:""}],Fh=()=>{const e=new Ph,[t]=je(),n=t.get("match"),a=t.get("focusLabel"),o=+(t.get("topN")||10),l=t.get("date")||i()().tz().format(Lt),s=Fa(l),c=(0,r.useRef)(),{serverUrl:u}=At(),[d,h]=(0,r.useState)(!1),[m,p]=(0,r.useState)(),[f,v]=(0,r.useState)(e.defaultTSDBStatus),[g,y]=(0,r.useState)(!1),_=async e=>{const t=await fetch(e);if(t.ok)return await t.json();throw new Error("Request failed with status ".concat(t.status))},b=async t=>{if(!u)return;p(""),h(!0),v(e.defaultTSDBStatus);const r={...t,date:t.date,topN:0,match:"",focusLabel:""},a={...t,date:i()(t.date).subtract(1,"day").format(Lt)},o=[Lh(u,t),Lh(u,a)];s!==l&&(t.match||t.focusLabel)&&o.push(Lh(u,r));try{var d,m,g,y,b,w,k,x,S,C;const[e,t,r]=await Promise.all(o.map(_)),a={...t.data},{data:i}=r||c.current||e;c.current={data:i};const l={...e.data,totalSeries:(null===(d=e.data)||void 0===d?void 0:d.totalSeries)||(null===(m=e.data)||void 0===m||null===(g=m.headStats)||void 0===g?void 0:g.numSeries)||0,totalLabelValuePairs:(null===(y=e.data)||void 0===y?void 0:y.totalLabelValuePairs)||(null===(b=e.data)||void 0===b||null===(w=b.headStats)||void 0===w?void 0:w.numLabelValuePairs)||0,seriesCountByLabelName:(null===(k=e.data)||void 0===k?void 0:k.seriesCountByLabelName)||[],seriesCountByFocusLabelValue:(null===(x=e.data)||void 0===x?void 0:x.seriesCountByFocusLabelValue)||[],totalSeriesByAll:(null===i||void 0===i?void 0:i.totalSeries)||(null===i||void 0===i||null===(S=i.headStats)||void 0===S?void 0:S.numSeries)||f.totalSeriesByAll||0,totalSeriesPrev:(null===a||void 0===a?void 0:a.totalSeries)||(null===a||void 0===a||null===(C=a.headStats)||void 0===C?void 0:C.numSeries)||0},s=null===n||void 0===n?void 0:n.replace(/[{}"]/g,"");l.seriesCountByLabelValuePair=l.seriesCountByLabelValuePair.filter((e=>e.name!==s)),((e,t)=>{Object.keys(e).forEach((n=>{const r=n,a=e[r],i=t[r];Array.isArray(a)&&Array.isArray(i)&&a.forEach((e=>{var t;const n=null===(t=i.find((t=>t.name===e.name)))||void 0===t?void 0:t.value;e.diff=n?e.value-n:0,e.valuePrev=n||0}))}))})(l,a),v(l),h(!1)}catch(ep){h(!1),ep instanceof Error&&p("".concat(ep.name,": ").concat(ep.message))}};return(0,r.useEffect)((()=>{b({topN:o,match:n,date:l,focusLabel:a})}),[u,n,a,o,l]),(0,r.useEffect)((()=>{m&&(v(e.defaultTSDBStatus),h(!1))}),[m]),(0,r.useEffect)((()=>{const e=Ge(u);y(!!e)}),[u]),e.tsdbStatusData=f,{isLoading:d,appConfigurator:e,error:m,isCluster:g}},jh={seriesCountByMetricName:e=>{let{query:t}=e;return Hh("__name__",t)},seriesCountByLabelName:e=>{let{query:t}=e;return"{".concat(t,'!=""}')},seriesCountByFocusLabelValue:e=>{let{query:t,focusLabel:n}=e;return Hh(n,t)},seriesCountByLabelValuePair:e=>{let{query:t}=e;const n=t.split("="),r=n[0],a=n.slice(1).join("=");return Hh(r,a)},labelValueCountByLabelName:e=>{let{query:t,match:n}=e;return""===n?"{".concat(t,'!=""}'):"".concat(n.replace("}",""),", ").concat(t,'!=""}')}},Hh=(e,t)=>e?"{"+e+"="+JSON.stringify(t)+"}":"",Vh=e=>{var t;let{totalSeries:n=0,totalSeriesPrev:r=0,totalSeriesAll:a=0,seriesCountByMetricName:i=[],isPrometheus:o}=e;const{isMobile:l}=Ur(),[s]=je(),c=s.get("match"),u=s.get("focusLabel"),d=/__name__/.test(c||""),h=(null===(t=i[0])||void 0===t?void 0:t.value)/a*100,m=n-r,p=Math.abs(m)/r*100,f=[{title:"Total series",value:n.toLocaleString("en-US"),dynamic:n&&r&&!o?"".concat(p.toFixed(2),"%"):"",display:!u,info:'The total number of active time series. \n A time series is uniquely identified by its name plus a set of its labels. \n For example, temperature{city="NY",country="US"} and temperature{city="SF",country="US"} \n are two distinct series, since they differ by the city label.'},{title:"Percentage from total",value:isNaN(h)?"-":"".concat(h.toFixed(2),"%"),display:d,info:"The share of these series in the total number of time series."}].filter((e=>e.display));return f.length?Et("div",{className:wr()({"vm-cardinality-totals":!0,"vm-cardinality-totals_mobile":l}),children:f.map((e=>{let{title:t,value:n,info:a,dynamic:i}=e;return Et("div",{className:"vm-cardinality-totals-card",children:[Et("h4",{className:"vm-cardinality-totals-card__title",children:[t,a&&Et(da,{title:Et("p",{className:"vm-cardinality-totals-card__tooltip",children:a}),children:Et("div",{className:"vm-cardinality-totals-card__info-icon",children:Et(On,{})})})]}),Et("span",{className:"vm-cardinality-totals-card__value",children:n}),!!i&&Et(da,{title:"in relation to the previous day: ".concat(r.toLocaleString("en-US")),children:Et("span",{className:wr()({"vm-dynamic-number":!0,"vm-dynamic-number_positive vm-dynamic-number_down":m<0,"vm-dynamic-number_negative vm-dynamic-number_up":m>0}),children:i})})]},t)}))}):null},$h=(e,t)=>{const[n]=je(),a=n.get(t)?n.get(t):e,[i,o]=(0,r.useState)(a);return(0,r.useEffect)((()=>{a!==i&&o(a)}),[a]),[i,o]},Uh=e=>{let{isPrometheus:t,isCluster:n,...a}=e;const{isMobile:i}=Ur(),[o]=je(),{setSearchParamsFromKeys:l}=ei(),s=o.get("tips")||"",[c,u]=$h("","match"),[d,h]=$h("","focusLabel"),[m,p]=$h(10,"topN"),f=(0,r.useMemo)((()=>m<0?"Number must be bigger than zero":""),[m]),v=()=>{l({match:c,topN:m,focusLabel:d})};return(0,r.useEffect)((()=>{const e=o.get("match"),t=+(o.get("topN")||10),n=o.get("focusLabel");e!==c&&u(e||""),t!==m&&p(t),n!==d&&h(n||"")}),[o]),Et("div",{className:wr()({"vm-cardinality-configurator":!0,"vm-cardinality-configurator_mobile":i,"vm-block":!0,"vm-block_mobile":i}),children:[Et("div",{className:"vm-cardinality-configurator-controls",children:[Et("div",{className:"vm-cardinality-configurator-controls__query",children:Et(Da,{label:"Time series selector",type:"string",value:c,onChange:u,onEnter:v})}),Et("div",{className:"vm-cardinality-configurator-controls__item",children:Et(Da,{label:"Focus label",type:"text",value:d||"",onChange:h,onEnter:v,endIcon:Et(da,{title:Et("div",{children:Et("p",{children:"To identify values with the highest number of series for the selected label."})}),children:Et(lr,{})})})}),Et("div",{className:"vm-cardinality-configurator-controls__item vm-cardinality-configurator-controls__item_limit",children:Et(Da,{label:"Limit entries",type:"number",value:t?10:m,error:f,disabled:t,helperText:t?"not available for Prometheus":"",onChange:e=>{const t=+e;p(isNaN(t)?0:t)},onEnter:v})})]}),Et("div",{className:"vm-cardinality-configurator-bottom",children:[Et(Vh,{isPrometheus:t,isCluster:n,...a}),n&&Et("div",{className:"vm-cardinality-configurator-bottom-helpful",children:Et(tl,{href:"https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html#cardinality-explorer-statistic-inaccuracy",withIcon:!0,children:[Et(ir,{}),"Statistic inaccuracy explanation"]})}),Et("div",{className:"vm-cardinality-configurator-bottom-helpful",children:Et(tl,{href:"https://docs.victoriametrics.com/#cardinality-explorer",withIcon:!0,children:[Et(ir,{}),"Documentation"]})}),Et("div",{className:"vm-cardinality-configurator-bottom__execute",children:[Et(da,{title:s?"Hide tips":"Show tips",children:Et(ea,{variant:"text",color:s?"warning":"gray",startIcon:Et(dr,{}),onClick:()=>{const e=o.get("tips")||"";l({tips:e?"":"true"})},ariaLabel:"visibility tips"})}),Et(ea,{variant:"text",startIcon:Et(Pn,{}),onClick:()=>{l({match:"",focusLabel:""})},children:"Reset"}),Et(ea,{startIcon:Et(Bn,{}),onClick:v,children:"Execute Query"})]})]})]})};function Bh(e){const{order:t,orderBy:n,onRequestSort:r,headerCells:a}=e;return Et("thead",{className:"vm-table-header vm-cardinality-panel-table__header",children:Et("tr",{className:"vm-table__row vm-table__row_header",children:a.map((e=>{return Et("th",{className:wr()({"vm-table-cell vm-table-cell_header":!0,"vm-table-cell_sort":"action"!==e.id&&"percentage"!==e.id,"vm-table-cell_right":"action"===e.id}),onClick:(a=e.id,e=>{r(e,a)}),children:Et("div",{className:"vm-table-cell__content",children:[e.info?Et(da,{title:e.info,children:[Et("div",{className:"vm-metrics-content-header__tip-icon",children:Et(On,{})}),e.label]}):Et(St.FK,{children:e.label}),"action"!==e.id&&"percentage"!==e.id&&Et("div",{className:wr()({"vm-table__sort-icon":!0,"vm-table__sort-icon_active":n===e.id,"vm-table__sort-icon_desc":"desc"===t&&n===e.id}),children:Et(jn,{})})]})},e.id);var a}))})})}const qh=["date","timestamp","time"];function Yh(e,t,n){const r=e[n],a=t[n],o=qh.includes("".concat(n))?i()("".concat(r)).unix():r,l=qh.includes("".concat(n))?i()("".concat(a)).unix():a;return lo?1:0}function Wh(e,t){return"desc"===e?(e,n)=>Yh(e,n,t):(e,n)=>-Yh(e,n,t)}function Kh(e,t){const n=e.map(((e,t)=>[e,t]));return n.sort(((e,n)=>{const r=t(e[0],n[0]);return 0!==r?r:e[1]-n[1]})),n.map((e=>e[0]))}const Qh=e=>{let{rows:t,headerCells:n,defaultSortColumn:a,tableCells:i}=e;const[o,l]=(0,r.useState)("desc"),[s,c]=(0,r.useState)(a),u=Kh(t,Wh(o,s));return Et("table",{className:"vm-table vm-cardinality-panel-table",children:[Et(Bh,{order:o,orderBy:s,onRequestSort:(e,t)=>{l(s===t&&"asc"===o?"desc":"asc"),c(t)},rowCount:t.length,headerCells:n}),Et("tbody",{className:"vm-table-header",children:u.map((e=>Et("tr",{className:"vm-table__row",children:i(e)},e.name)))})]})},Zh=e=>{let{row:t,totalSeries:n,totalSeriesPrev:r,onActionClick:a}=e;const i=n>0?t.value/n*100:-1,o=r>0?t.valuePrev/r*100:-1,l=[i,o].some((e=>-1===e)),s=i-o,c=l?"":"".concat(s.toFixed(2),"%"),u=()=>{a(t.name)};return Et(St.FK,{children:[Et("td",{className:"vm-table-cell",children:Et("span",{className:"vm-link vm-link_colored",onClick:u,children:t.name})},t.name),Et("td",{className:"vm-table-cell",children:[t.value,!!t.diff&&Et(da,{title:"in relation to the previous day: ".concat(t.valuePrev),children:Et("span",{className:wr()({"vm-dynamic-number":!0,"vm-dynamic-number_positive":t.diff<0,"vm-dynamic-number_negative":t.diff>0}),children:["\xa0",t.diff>0?"+":"",t.diff]})})]},t.value),i>0&&Et("td",{className:"vm-table-cell",children:Et("div",{className:"vm-cardinality-panel-table__progress",children:[Et(il,{value:i}),c&&Et(da,{title:"in relation to the previous day",children:Et("span",{className:wr()({"vm-dynamic-number":!0,"vm-dynamic-number_positive vm-dynamic-number_down":s<0,"vm-dynamic-number_negative vm-dynamic-number_up":s>0}),children:c})})]})},t.progressValue),Et("td",{className:"vm-table-cell vm-table-cell_right",children:Et("div",{className:"vm-table-cell__content",children:Et(da,{title:"Filter by ".concat(t.name),children:Et(ea,{variant:"text",size:"small",onClick:u,children:Et(qn,{})})})})},"action")]})},Gh=e=>{let{data:t}=e;const[n,a]=(0,r.useState)([]),[i,o]=(0,r.useState)([0,0]);return(0,r.useEffect)((()=>{const e=t.sort(((e,t)=>t.value-e.value)),n=(e=>{const t=e.map((e=>e.value)),n=Math.ceil(t[0]||1),r=n/9;return new Array(11).fill(n+r).map(((e,t)=>Math.round(e-r*t)))})(e);o(n),a(e.map((e=>({...e,percentage:e.value/n[0]*100}))))}),[t]),Et("div",{className:"vm-simple-bar-chart",children:[Et("div",{className:"vm-simple-bar-chart-y-axis",children:i.map((e=>Et("div",{className:"vm-simple-bar-chart-y-axis__tick",children:e},e)))}),Et("div",{className:"vm-simple-bar-chart-data",children:n.map((e=>{let{name:t,value:n,percentage:r}=e;return Et(da,{title:"".concat(t,": ").concat(n),placement:"top-center",children:Et("div",{className:"vm-simple-bar-chart-data-item",style:{maxHeight:"".concat(r||0,"%")}})},"".concat(t,"_").concat(n))}))})]})},Jh=e=>{let{rows:t,tabs:n=[],chartContainer:a,totalSeries:i,totalSeriesPrev:o,onActionClick:l,sectionTitle:s,tip:c,tableHeaderCells:u,isPrometheus:d}=e;const{isMobile:h}=Ur(),[m,p]=(0,r.useState)("table"),f=d&&!t.length,v=(0,r.useMemo)((()=>n.map(((e,t)=>({value:e,label:e,icon:Et(0===t?Wn:Yn,{})})))),[n]);return Et("div",{className:wr()({"vm-metrics-content":!0,"vm-metrics-content_mobile":h,"vm-block":!0,"vm-block_mobile":h}),children:[Et("div",{className:"vm-metrics-content-header vm-section-header",children:[Et("h5",{className:wr()({"vm-metrics-content-header__title":!0,"vm-section-header__title":!0,"vm-section-header__title_mobile":h}),children:[!h&&c&&Et(da,{title:Et("p",{dangerouslySetInnerHTML:{__html:c},className:"vm-metrics-content-header__tip"}),children:Et("div",{className:"vm-metrics-content-header__tip-icon",children:Et(On,{})})}),s]}),Et("div",{className:"vm-section-header__tabs",children:Et(Er,{activeItem:m,items:v,onChange:p})})]}),f&&Et("div",{className:"vm-metrics-content-prom-data",children:[Et("div",{className:"vm-metrics-content-prom-data__icon",children:Et(On,{})}),Et("h3",{className:"vm-metrics-content-prom-data__title",children:"Prometheus Data Limitation"}),Et("p",{className:"vm-metrics-content-prom-data__text",children:["Due to missing data from your Prometheus source, some tables may appear empty.",Et("br",{}),"This does not indicate an issue with your system or our tool."]})]}),!f&&"table"===m&&Et("div",{ref:a,className:wr()({"vm-metrics-content__table":!0,"vm-metrics-content__table_mobile":h}),children:Et(Qh,{rows:t,headerCells:u,defaultSortColumn:"value",tableCells:e=>Et(Zh,{row:e,totalSeries:i,totalSeriesPrev:o,onActionClick:l})})}),!f&&"graph"===m&&Et("div",{className:"vm-metrics-content__chart",children:Et(Gh,{data:t.map((e=>{let{name:t,value:n}=e;return{name:t,value:n}}))})})]})},Xh=e=>{let{title:t,children:n}=e;return Et("div",{className:"vm-cardinality-tip",children:[Et("div",{className:"vm-cardinality-tip-header",children:[Et("div",{className:"vm-cardinality-tip-header__tip-icon",children:Et(dr,{})}),Et("h4",{className:"vm-cardinality-tip-header__title",children:t||"Tips"})]}),Et("p",{className:"vm-cardinality-tip__description",children:n})]})},em=()=>Et(Xh,{title:"Metrics with a high number of series",children:Et("ul",{children:[Et("li",{children:["Identify and eliminate labels with frequently changed values to reduce their\xa0",Et(tl,{href:"https://docs.victoriametrics.com/FAQ.html#what-is-high-cardinality",children:"cardinality"}),"\xa0and\xa0",Et(tl,{href:"https://docs.victoriametrics.com/FAQ.html#what-is-high-churn-rate",children:"high churn rate"})]}),Et("li",{children:["Find unused time series and\xa0",Et(tl,{href:"https://docs.victoriametrics.com/relabeling.html",children:"drop entire metrics"})]}),Et("li",{children:["Aggregate time series before they got ingested into the database via\xa0",Et(tl,{href:"https://docs.victoriametrics.com/stream-aggregation.html",children:"streaming aggregation"})]})]})}),tm=()=>Et(Xh,{title:"Labels with a high number of unique values",children:Et("ul",{children:[Et("li",{children:"Decrease the number of unique label values to reduce cardinality"}),Et("li",{children:["Drop the label entirely via\xa0",Et(tl,{href:"https://docs.victoriametrics.com/relabeling.html",children:"relabeling"})]}),Et("li",{children:"For volatile label values (such as URL path, user session, etc.) consider printing them to the log file instead of adding to time series"})]})}),nm=()=>Et(Xh,{title:"Dashboard of a single metric",children:[Et("p",{children:"This dashboard helps to understand the cardinality of a single metric."}),Et("p",{children:"Each time series is a unique combination of key-value label pairs. Therefore a label key with many values can create a lot of time series for a particular metric. If you\u2019re trying to decrease the cardinality of a metric, start by looking at the labels with the highest number of values."}),Et("p",{children:"Use the series selector at the top of the page to apply additional filters."})]}),rm=()=>Et(Xh,{title:"Dashboard of a label",children:[Et("p",{children:"This dashboard helps you understand the count of time series per label."}),Et("p",{children:"Use the selector at the top of the page to pick a label name you\u2019d like to inspect. For the selected label name, you\u2019ll see the label values that have the highest number of series associated with them. So if you\u2019ve chosen `instance` as your label name, you may see that `657` time series have value \u201chost-1\u201d attached to them and `580` time series have value `host-2` attached to them."}),Et("p",{children:"This can be helpful in allowing you to determine where the bulk of your time series are coming from. If the label \u201cinstance=host-1\u201d was applied to 657 series and the label \u201cinstance=host-2\u201d was only applied to 580 series, you\u2019d know, for example, that host-01 was responsible for sending the majority of the time series."})]}),am=()=>{const{isMobile:e}=Ur(),[t]=je(),{setSearchParamsFromKeys:n}=ei(),r=t.get("tips")||"",a=t.get("match")||"",i=t.get("focusLabel")||"",{isLoading:o,appConfigurator:l,error:s,isCluster:c}=Fh(),{tsdbStatusData:u,getDefaultState:d,tablesHeaders:h,sectionsTips:m}=l,p=d(a,i);return Et("div",{className:wr()({"vm-cardinality-panel":!0,"vm-cardinality-panel_mobile":e}),children:[o&&Et(Bo,{message:"Please wait while cardinality stats is calculated. \n This may take some time if the db contains big number of time series."}),Et(Uh,{isPrometheus:l.isPrometheusData,totalSeries:u.totalSeries,totalSeriesPrev:u.totalSeriesPrev,totalSeriesAll:u.totalSeriesByAll,totalLabelValuePairs:u.totalLabelValuePairs,seriesCountByMetricName:u.seriesCountByMetricName,isCluster:c}),r&&Et("div",{className:"vm-cardinality-panel-tips",children:[!a&&!i&&Et(em,{}),a&&!i&&Et(nm,{}),!a&&!i&&Et(tm,{}),i&&Et(rm,{})]}),s&&Et(qr,{variant:"error",children:s}),l.keys(a,i).map((e=>{return Et(Jh,{sectionTitle:l.sectionsTitles(i)[e],tip:m[e],rows:u[e],onActionClick:(t=e,e=>{const r={match:jh[t]({query:e,focusLabel:i,match:a})};"labelValueCountByLabelName"!==t&&"seriesCountByLabelName"!=t||(r.focusLabel=e),"seriesCountByFocusLabelValue"==t&&(r.focusLabel=""),n(r)}),tabs:p.tabs[e],chartContainer:p.containerRefs[e],totalSeriesPrev:l.totalSeries(e,!0),totalSeries:l.totalSeries(e),tableHeaderCells:h[e],isPrometheus:l.isPrometheusData},e);var t}))]})},im=e=>(["topByAvgDuration","topByCount","topBySumDuration"].forEach((t=>{const n=e[t];Array.isArray(n)&&n.forEach((e=>{const t=Xt(1e3*e.timeRangeSeconds);e.url=((e,t)=>{var n;const{query:r,timeRangeSeconds:a}=e,i=["g0.expr=".concat(encodeURIComponent(r))],o=null===(n=nn.find((e=>e.duration===t)))||void 0===n?void 0:n.id;return o&&i.push("g0.relative_time=".concat(o)),a&&i.push("g0.range_input=".concat(t)),"".concat(Ye.home,"?").concat(i.join("&"))})(e,t),e.timeRange=t}))})),e),om=e=>{let{topN:t,maxLifetime:n}=e;const{serverUrl:a}=At(),{setSearchParamsFromKeys:i}=ei(),[o,l]=(0,r.useState)(null),[s,c]=(0,r.useState)(!1),[u,d]=(0,r.useState)(),h=(0,r.useMemo)((()=>((e,t,n)=>"".concat(e,"/api/v1/status/top_queries?topN=").concat(t||"","&maxLifetime=").concat(n||""))(a,t,n)),[a,t,n]);return{data:o,error:u,loading:s,fetch:async()=>{c(!0),i({topN:t,maxLifetime:n});try{const e=await fetch(h),t=await e.json();l(e.ok?im(t):null),d(String(t.error||""))}catch(ep){ep instanceof Error&&"AbortError"!==ep.name&&d("".concat(ep.name,": ").concat(ep.message))}c(!1)}}},lm=e=>{let{rows:t,columns:n,defaultOrderBy:a}=e;const i=Fo(),[o,l]=(0,r.useState)(a||"count"),[s,c]=(0,r.useState)("desc"),u=(0,r.useMemo)((()=>Kh(t,Wh(s,o))),[t,o,s]),d=e=>()=>{var t;t=e,c((e=>"asc"===e&&o===t?"desc":"asc")),l(t)},h=e=>{let{query:t}=e;return async()=>{await i(t,"Query has been copied")}};return Et("table",{className:"vm-table",children:[Et("thead",{className:"vm-table-header",children:Et("tr",{className:"vm-table__row vm-table__row_header",children:[n.map((e=>Et("th",{className:"vm-table-cell vm-table-cell_header vm-table-cell_sort",onClick:d(e.sortBy||e.key),children:Et("div",{className:"vm-table-cell__content",children:[e.title||e.key,Et("div",{className:wr()({"vm-table__sort-icon":!0,"vm-table__sort-icon_active":o===e.key,"vm-table__sort-icon_desc":"desc"===s&&o===e.key}),children:Et(jn,{})})]})},e.key))),Et("th",{className:"vm-table-cell vm-table-cell_header"})," "]})}),Et("tbody",{className:"vm-table-body",children:u.map(((e,t)=>Et("tr",{className:"vm-table__row",children:[n.map((t=>Et("td",{className:"vm-table-cell",children:e[t.key]||"-"},t.key))),Et("td",{className:"vm-table-cell vm-table-cell_no-padding",children:Et("div",{className:"vm-top-queries-panels__table-actions",children:[e.url&&Et(da,{title:"Execute query",children:Et(Ie,{to:e.url,target:"_blank",rel:"noreferrer","aria-disabled":!0,children:Et(ea,{variant:"text",size:"small",startIcon:Et(qn,{}),ariaLabel:"execute query"})})}),Et(da,{title:"Copy query",children:Et(ea,{variant:"text",size:"small",startIcon:Et(nr,{}),onClick:h(e),ariaLabel:"copy query"})})]})})]},t)))})]})},sm=["table","JSON"].map(((e,t)=>({value:String(t),label:e,icon:Et(0===t?Wn:Kn,{})}))),cm=e=>{let{rows:t,title:n,columns:a,defaultOrderBy:i}=e;const{isMobile:o}=Ur(),[l,s]=(0,r.useState)(0);return Et("div",{className:wr()({"vm-top-queries-panel":!0,"vm-block":!0,"vm-block_mobile":o}),children:[Et("div",{className:wr()({"vm-top-queries-panel-header":!0,"vm-section-header":!0,"vm-top-queries-panel-header_mobile":o}),children:[Et("h5",{className:wr()({"vm-section-header__title":!0,"vm-section-header__title_mobile":o}),children:n}),Et("div",{className:"vm-section-header__tabs",children:Et(Er,{activeItem:String(l),items:sm,onChange:e=>{s(+e)}})})]}),Et("div",{className:wr()({"vm-top-queries-panel__table":!0,"vm-top-queries-panel__table_mobile":o}),children:[0===l&&Et(lm,{rows:t,columns:a,defaultOrderBy:i}),1===l&&Et(ph,{data:t})]})]})},um=()=>{const{isMobile:e}=Ur(),[t,n]=$h(10,"topN"),[a,o]=$h("10m","maxLifetime"),{data:l,error:s,loading:c,fetch:u}=om({topN:t,maxLifetime:a}),d=(0,r.useMemo)((()=>{const e=a.trim().split(" ").reduce(((e,t)=>{const n=Wt(t);return n?{...e,...n}:{...e}}),{});return!!i().duration(e).asMilliseconds()}),[a]),h=(0,r.useMemo)((()=>!!t&&t<1),[t]),m=(0,r.useMemo)((()=>h?"Number must be bigger than zero":""),[h]),p=(0,r.useMemo)((()=>d?"":"Invalid duration value"),[d]),f=e=>{if(!l)return e;const t=l[e];return"number"===typeof t?hd(t,t,t):t||e},v=e=>{"Enter"===e.key&&u()};return(0,r.useEffect)((()=>{l&&(t||n(+l.topN),a||o(l.maxLifetime))}),[l]),(0,r.useEffect)((()=>(u(),window.addEventListener("popstate",u),()=>{window.removeEventListener("popstate",u)})),[]),Et("div",{className:wr()({"vm-top-queries":!0,"vm-top-queries_mobile":e}),children:[c&&Et(Bo,{containerStyles:{height:"500px"}}),Et("div",{className:wr()({"vm-top-queries-controls":!0,"vm-block":!0,"vm-block_mobile":e}),children:[Et("div",{className:"vm-top-queries-controls-fields",children:[Et("div",{className:"vm-top-queries-controls-fields__item",children:Et(Da,{label:"Max lifetime",value:a,error:p,helperText:"For example ".concat("30ms, 15s, 3d4h, 1y2w"),onChange:e=>{o(e)},onKeyDown:v})}),Et("div",{className:"vm-top-queries-controls-fields__item",children:Et(Da,{label:"Number of returned queries",type:"number",value:t||"",error:m,onChange:e=>{n(+e)},onKeyDown:v})})]}),Et("div",{className:wr()({"vm-top-queries-controls-bottom":!0,"vm-top-queries-controls-bottom_mobile":e}),children:[Et("div",{className:"vm-top-queries-controls-bottom__info",children:["VictoriaMetrics tracks the last\xa0",Et(da,{title:"search.queryStats.lastQueriesCount",children:Et("b",{children:f("search.queryStats.lastQueriesCount")})}),"\xa0queries with durations at least\xa0",Et(da,{title:"search.queryStats.minQueryDuration",children:Et("b",{children:f("search.queryStats.minQueryDuration")})})]}),Et("div",{className:"vm-top-queries-controls-bottom__button",children:Et(ea,{startIcon:Et(Bn,{}),onClick:u,children:"Execute"})})]})]}),s&&Et(qr,{variant:"error",children:s}),l&&Et(St.FK,{children:Et("div",{className:"vm-top-queries-panels",children:[Et(cm,{rows:l.topBySumDuration,title:"Queries with most summary time to execute",columns:[{key:"query"},{key:"sumDurationSeconds",title:"sum duration, sec"},{key:"timeRange",sortBy:"timeRangeSeconds",title:"query time interval"},{key:"count"}],defaultOrderBy:"sumDurationSeconds"}),Et(cm,{rows:l.topByAvgDuration,title:"Most heavy queries",columns:[{key:"query"},{key:"avgDurationSeconds",title:"avg duration, sec"},{key:"timeRange",sortBy:"timeRangeSeconds",title:"query time interval"},{key:"count"}],defaultOrderBy:"avgDurationSeconds"}),Et(cm,{rows:l.topByCount,title:"Most frequently executed queries",columns:[{key:"query"},{key:"timeRange",sortBy:"timeRangeSeconds",title:"query time interval"},{key:"count"}]})]})})]})},dm={"color-primary":"#589DF6","color-secondary":"#316eca","color-error":"#e5534b","color-warning":"#c69026","color-info":"#539bf5","color-success":"#57ab5a","color-background-body":"#22272e","color-background-block":"#2d333b","color-background-tooltip":"rgba(22, 22, 22, 0.8)","color-text":"#cdd9e5","color-text-secondary":"#768390","color-text-disabled":"#636e7b","box-shadow":"rgba(0, 0, 0, 0.16) 1px 2px 6px","box-shadow-popper":"rgba(0, 0, 0, 0.2) 0px 2px 8px 0px","border-divider":"1px solid rgba(99, 110, 123, 0.5)","color-hover-black":"rgba(0, 0, 0, 0.12)"},hm={"color-primary":"#3F51B5","color-secondary":"#E91E63","color-error":"#FD080E","color-warning":"#FF8308","color-info":"#03A9F4","color-success":"#4CAF50","color-background-body":"#FEFEFF","color-background-block":"#FFFFFF","color-background-tooltip":"rgba(80,80,80,0.9)","color-text":"#110f0f","color-text-secondary":"#706F6F","color-text-disabled":"#A09F9F","box-shadow":"rgba(0, 0, 0, 0.08) 1px 2px 6px","box-shadow-popper":"rgba(0, 0, 0, 0.1) 0px 2px 8px 0px","border-divider":"1px solid rgba(0, 0, 0, 0.15)","color-hover-black":"rgba(0, 0, 0, 0.06)"},mm=()=>{const[e,t]=(0,r.useState)(yt()),n=e=>{t(e.matches)};return(0,r.useEffect)((()=>{const e=window.matchMedia("(prefers-color-scheme: dark)");return e.addEventListener("change",n),()=>e.removeEventListener("change",n)}),[]),e},pm=["primary","secondary","error","warning","info","success"],fm=e=>{let{onLoaded:t}=e;const n=Ke(),{palette:a={}}=We(),{theme:i}=At(),o=mm(),l=Mt(),s=Cr(),[c,u]=(0,r.useState)({[pt.dark]:dm,[pt.light]:hm,[pt.system]:yt()?dm:hm}),d=()=>{const{innerWidth:e,innerHeight:t}=window,{clientWidth:n,clientHeight:r}=document.documentElement;gt("scrollbar-width","".concat(e-n,"px")),gt("scrollbar-height","".concat(t-r,"px")),gt("vh","".concat(.01*t,"px"))},h=()=>{pm.forEach(((e,n)=>{const r=(e=>{let t=e.replace("#","").trim();if(3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6!==t.length)throw new Error("Invalid HEX color.");return(299*parseInt(t.slice(0,2),16)+587*parseInt(t.slice(2,4),16)+114*parseInt(t.slice(4,6),16))/1e3>=128?"#000000":"#FFFFFF"})(vt("color-".concat(e)));gt("".concat(e,"-text"),r),n===pm.length-1&&(l({type:"SET_DARK_THEME"}),t(!0))}))},m=()=>{const e=Xe("THEME")||pt.system,t=c[e];Object.entries(t).forEach((e=>{let[t,n]=e;gt(t,n)})),h(),n&&(pm.forEach((e=>{const t=a[e];t&>("color-".concat(e),t)})),h())};return(0,r.useEffect)((()=>{d(),m()}),[c]),(0,r.useEffect)(d,[s]),(0,r.useEffect)((()=>{const e=yt()?dm:hm;c[pt.system]!==e?u((t=>({...t,[pt.system]:e}))):m()}),[i,o]),(0,r.useEffect)((()=>{n&&l({type:"SET_THEME",payload:pt.light})}),[]),null},vm=()=>{const[e,t]=(0,r.useState)([]),[n,a]=(0,r.useState)(!1),i=(0,r.useRef)(document.body),o=e=>{e.preventDefault(),e.stopPropagation(),"dragenter"===e.type||"dragover"===e.type?a(!0):"dragleave"===e.type&&a(!1)};return Sr("dragenter",o,i),Sr("dragleave",o,i),Sr("dragover",o,i),Sr("drop",(e=>{var n;e.preventDefault(),e.stopPropagation(),a(!1),null!==e&&void 0!==e&&null!==(n=e.dataTransfer)&&void 0!==n&&n.files&&e.dataTransfer.files[0]&&(e=>{const n=Array.from(e||[]);t(n)})(e.dataTransfer.files)}),i),Sr("paste",(e=>{var n;const r=null===(n=e.clipboardData)||void 0===n?void 0:n.items;if(!r)return;const a=Array.from(r).filter((e=>"application/json"===e.type)).map((e=>e.getAsFile())).filter((e=>null!==e));t(a)}),i),{files:e,dragging:n}},gm=e=>{let{onOpenModal:t,onChange:n}=e;return Et("div",{className:"vm-upload-json-buttons",children:[Et(ea,{variant:"outlined",onClick:t,children:"Paste JSON"}),Et(ea,{children:["Upload Files",Et("input",{id:"json",type:"file",accept:"application/json",multiple:!0,title:" ",onChange:n})]})]})},ym=()=>{const[e,t]=(0,r.useState)([]),[n,a]=(0,r.useState)([]),i=(0,r.useMemo)((()=>!!e.length),[e]),{value:o,setTrue:l,setFalse:s}=na(!1),c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";a((n=>[{filename:t,text:": ".concat(e.message)},...n]))},u=(e,n)=>{try{const r=JSON.parse(e),a=r.trace||r;if(!a.duration_msec)return void c(new Error(mt.traceNotFound),n);const i=new Ko(a,n);t((e=>[i,...e]))}catch(ep){ep instanceof Error&&c(ep,n)}},d=e=>{e.map((e=>{const t=new FileReader,n=(null===e||void 0===e?void 0:e.name)||"";t.onload=e=>{var t;const r=String(null===(t=e.target)||void 0===t?void 0:t.result);u(r,n)},t.readAsText(e)}))},h=e=>{a([]);const t=Array.from(e.target.files||[]);d(t),e.target.value=""},m=e=>()=>{(e=>{a((t=>t.filter(((t,n)=>n!==e))))})(e)},{files:p,dragging:f}=vm();return(0,r.useEffect)((()=>{d(p)}),[p]),Et("div",{className:"vm-trace-page",children:[Et("div",{className:"vm-trace-page-header",children:[Et("div",{className:"vm-trace-page-header-errors",children:n.map(((e,t)=>Et("div",{className:"vm-trace-page-header-errors-item",children:[Et(qr,{variant:"error",children:[Et("b",{className:"vm-trace-page-header-errors-item__filename",children:e.filename}),Et("span",{children:e.text})]}),Et(ea,{className:"vm-trace-page-header-errors-item__close",startIcon:Et(Ln,{}),variant:"text",color:"error",onClick:m(t)})]},"".concat(e,"_").concat(t))))}),Et("div",{children:i&&Et(gm,{onOpenModal:l,onChange:h})})]}),i&&Et("div",{children:Et(cl,{jsonEditor:!0,traces:e,onDeleteClick:n=>{const r=e.filter((e=>e.idValue!==n.idValue));t([...r])}})}),!i&&Et("div",{className:"vm-trace-page-preview",children:[Et("p",{className:"vm-trace-page-preview__text",children:["Please, upload file with JSON response content.","\n","The file must contain tracing information in JSON format.","\n","In order to use tracing please refer to the doc:\xa0",Et("a",{className:"vm-link vm-link_colored",href:"https://docs.victoriametrics.com/#query-tracing",target:"_blank",rel:"help noreferrer",children:"https://docs.victoriametrics.com/#query-tracing"}),"\n","Tracing graph will be displayed after file upload.","\n","Attach files by dragging & dropping, selecting or pasting them."]}),Et(gm,{onOpenModal:l,onChange:h})]}),o&&Et(ua,{title:"Paste JSON",onClose:s,children:Et(sl,{editable:!0,displayTitle:!0,defaultTile:"JSON ".concat(e.length+1),onClose:s,onUpload:u})}),f&&Et("div",{className:"vm-trace-page__dropzone"})]})},_m=e=>{const{serverUrl:t}=At(),{period:n}=pn(),[a,i]=(0,r.useState)([]),[o,l]=(0,r.useState)(!1),[s,c]=(0,r.useState)(),u=(0,r.useMemo)((()=>((e,t,n)=>{const r="{job=".concat(JSON.stringify(n),"}");return"".concat(e,"/api/v1/label/instance/values?match[]=").concat(encodeURIComponent(r),"&start=").concat(t.start,"&end=").concat(t.end)})(t,n,e)),[t,n,e]);return(0,r.useEffect)((()=>{if(!e)return;(async()=>{l(!0);try{const e=await fetch(u),t=await e.json(),n=t.data||[];i(n.sort(((e,t)=>e.localeCompare(t)))),e.ok?c(void 0):c("".concat(t.errorType,"\r\n").concat(null===t||void 0===t?void 0:t.error))}catch(ep){ep instanceof Error&&c("".concat(ep.name,": ").concat(ep.message))}l(!1)})().catch(console.error)}),[u]),{instances:a,isLoading:o,error:s}},bm=(e,t)=>{const{serverUrl:n}=At(),{period:a}=pn(),[i,o]=(0,r.useState)([]),[l,s]=(0,r.useState)(!1),[c,u]=(0,r.useState)(),d=(0,r.useMemo)((()=>((e,t,n,r)=>{const a=Object.entries({job:n,instance:r}).filter((e=>e[1])).map((e=>{let[t,n]=e;return"".concat(t,"=").concat(JSON.stringify(n))})).join(","),i="{".concat(a,"}");return"".concat(e,"/api/v1/label/__name__/values?match[]=").concat(encodeURIComponent(i),"&start=").concat(t.start,"&end=").concat(t.end)})(n,a,e,t)),[n,a,e,t]);return(0,r.useEffect)((()=>{if(!e)return;(async()=>{s(!0);try{const e=await fetch(d),t=await e.json(),n=t.data||[];o(n.sort(((e,t)=>e.localeCompare(t)))),e.ok?u(void 0):u("".concat(t.errorType,"\r\n").concat(null===t||void 0===t?void 0:t.error))}catch(ep){ep instanceof Error&&u("".concat(ep.name,": ").concat(ep.message))}s(!1)})().catch(console.error)}),[d]),{names:i,isLoading:l,error:c}},wm=e=>{let{name:t,job:n,instance:a,rateEnabled:i,isBucket:o,height:l}=e;const{isMobile:s}=Ur(),{customStep:c,yaxis:u}=jr(),{period:d}=pn(),h=Hr(),m=fn(),p=Qt(d.end-d.start),f=Kt(c),v=Xt(10*f*1e3),[g,y]=(0,r.useState)(!1),[_,b]=(0,r.useState)(!1),w=g&&c===p?v:c,k=(0,r.useMemo)((()=>{const e=Object.entries({job:n,instance:a}).filter((e=>e[1])).map((e=>{let[t,n]=e;return"".concat(t,"=").concat(JSON.stringify(n))}));e.push("__name__=".concat(JSON.stringify(t))),"node_cpu_seconds_total"==t&&e.push('mode!="idle"');const r="{".concat(e.join(","),"}");if(o)return"sum(rate(".concat(r,")) by (vmrange, le)");const l=i?"rollup_rate(".concat(r,")"):"rollup(".concat(r,")");return"\nwith (q = ".concat(l,') (\n alias(min(label_match(q, "rollup", "min")), "min"),\n alias(max(label_match(q, "rollup", "max")), "max"),\n alias(avg(label_match(q, "rollup", "avg")), "avg"),\n)')}),[t,n,a,i,o]),{isLoading:x,graphData:S,error:C,queryErrors:E,warning:N,isHistogram:A}=Xo({predefinedQuery:[k],visible:!0,customStep:w,showAllSeries:_});return(0,r.useEffect)((()=>{y(A)}),[A]),Et("div",{className:wr()({"vm-explore-metrics-graph":!0,"vm-explore-metrics-graph_mobile":s}),children:[x&&Et(Bo,{}),C&&Et(qr,{variant:"error",children:C}),E[0]&&Et(qr,{variant:"error",children:E[0]}),N&&Et(dl,{warning:N,query:[k],onChange:b}),S&&d&&Et(sh,{data:S,period:d,customStep:w,query:[k],yaxis:u,setYaxisLimits:e=>{h({type:"SET_YAXIS_LIMITS",payload:e})},setPeriod:e=>{let{from:t,to:n}=e;m({type:"SET_PERIOD",payload:{from:t,to:n}})},showLegend:!1,height:l,isHistogram:A})]})},km=e=>{let{name:t,index:n,length:r,isBucket:a,rateEnabled:i,onChangeRate:o,onRemoveItem:l,onChangeOrder:s}=e;const{isMobile:c}=Ur(),{value:u,setTrue:d,setFalse:h}=na(!1),m=()=>{l(t)},p=()=>{s(t,n,n+1)},f=()=>{s(t,n,n-1)};return Et("div",c?{className:"vm-explore-metrics-item-header vm-explore-metrics-item-header_mobile",children:[Et("div",{className:"vm-explore-metrics-item-header__name",children:t}),Et(ea,{variant:"text",size:"small",startIcon:Et(cr,{}),onClick:d,ariaLabel:"open panel settings"}),u&&Et(ua,{title:t,onClose:h,children:Et("div",{className:"vm-explore-metrics-item-header-modal",children:[Et("div",{className:"vm-explore-metrics-item-header-modal-order",children:[Et(ea,{startIcon:Et(Gn,{}),variant:"outlined",onClick:f,disabled:0===n,ariaLabel:"move graph up"}),Et("p",{children:["position:",Et("span",{className:"vm-explore-metrics-item-header-modal-order__index",children:["#",n+1]})]}),Et(ea,{endIcon:Et(Zn,{}),variant:"outlined",onClick:p,disabled:n===r-1,ariaLabel:"move graph down"})]}),!a&&Et("div",{className:"vm-explore-metrics-item-header-modal__rate",children:[Et(Io,{label:Et("span",{children:["enable ",Et("code",{children:"rate()"})]}),value:i,onChange:o,fullWidth:!0}),Et("p",{children:"calculates the average per-second speed of metrics change"})]}),Et(ea,{startIcon:Et(Ln,{}),color:"error",variant:"outlined",onClick:m,fullWidth:!0,children:"Remove graph"})]})})]}:{className:"vm-explore-metrics-item-header",children:[Et("div",{className:"vm-explore-metrics-item-header-order",children:[Et(da,{title:"move graph up",children:Et(ea,{className:"vm-explore-metrics-item-header-order__up",startIcon:Et(Fn,{}),variant:"text",color:"gray",size:"small",onClick:f,ariaLabel:"move graph up"})}),Et("div",{className:"vm-explore-metrics-item-header__index",children:["#",n+1]}),Et(da,{title:"move graph down",children:Et(ea,{className:"vm-explore-metrics-item-header-order__down",startIcon:Et(Fn,{}),variant:"text",color:"gray",size:"small",onClick:p,ariaLabel:"move graph down"})})]}),Et("div",{className:"vm-explore-metrics-item-header__name",children:t}),!a&&Et("div",{className:"vm-explore-metrics-item-header__rate",children:Et(da,{title:"calculates the average per-second speed of metric's change",children:Et(Io,{label:Et("span",{children:["enable ",Et("code",{children:"rate()"})]}),value:i,onChange:o})})}),Et("div",{className:"vm-explore-metrics-item-header__close",children:Et(da,{title:"close graph",children:Et(ea,{startIcon:Et(Ln,{}),variant:"text",color:"gray",size:"small",onClick:m,ariaLabel:"close graph"})})})]})},xm=e=>{let{name:t,job:n,instance:a,index:i,length:o,size:l,onRemoveItem:s,onChangeOrder:c}=e;const u=(0,r.useMemo)((()=>/_sum?|_total?|_count?/.test(t)),[t]),d=(0,r.useMemo)((()=>/_bucket?/.test(t)),[t]),[h,m]=(0,r.useState)(u),p=Cr(),f=(0,r.useMemo)(l.height,[l,p]);return(0,r.useEffect)((()=>{m(u)}),[n]),Et("div",{className:"vm-explore-metrics-item vm-block vm-block_empty-padding",children:[Et(km,{name:t,index:i,length:o,isBucket:d,rateEnabled:h,size:l.id,onChangeRate:m,onRemoveItem:s,onChangeOrder:c}),Et(wm,{name:t,job:n,instance:a,rateEnabled:h,isBucket:d,height:f},"".concat(t,"_").concat(n,"_").concat(a,"_").concat(h))]})},Sm=e=>{let{values:t,onRemoveItem:n}=e;const{isMobile:r}=Ur();return r?Et("span",{className:"vm-select-input-content__counter",children:["selected ",t.length]}):Et(St.FK,{children:t.map((e=>{return Et("div",{className:"vm-select-input-content__selected",children:[Et("span",{children:e}),Et("div",{onClick:(t=e,e=>{n(t),e.stopPropagation()}),children:Et(Ln,{})})]},e);var t}))})},Cm=e=>{let{value:t,list:n,label:a,placeholder:i,noOptionsText:o,clearable:l=!1,searchable:s=!1,autofocus:c,disabled:u,onChange:d}=e;const{isDarkTheme:h}=At(),{isMobile:m}=Ur(),[p,f]=(0,r.useState)(""),v=(0,r.useRef)(null),[g,y]=(0,r.useState)(null),[_,b]=(0,r.useState)(!1),w=(0,r.useRef)(null),k=Array.isArray(t),x=Array.isArray(t)?t:void 0,S=m&&k&&!(null===x||void 0===x||!x.length),C=(0,r.useMemo)((()=>_?p:Array.isArray(t)?"":t),[t,p,_,k]),E=(0,r.useMemo)((()=>_?p||"(.+)":""),[p,_]),N=()=>{w.current&&w.current.blur()},A=()=>{b(!1),N()},M=e=>{f(""),d(e),k||A(),k&&w.current&&w.current.focus()};return(0,r.useEffect)((()=>{f(""),_&&w.current&&w.current.focus(),_||N()}),[_,w]),(0,r.useEffect)((()=>{c&&w.current&&!m&&w.current.focus()}),[c,w]),Sr("keyup",(e=>{w.current!==e.target&&b(!1)})),Xr(v,A,g),Et("div",{className:wr()({"vm-select":!0,"vm-select_dark":h,"vm-select_disabled":u}),children:[Et("div",{className:"vm-select-input",onClick:e=>{e.target instanceof HTMLInputElement||u||b((e=>!e))},ref:v,children:[Et("div",{className:"vm-select-input-content",children:[!(null===x||void 0===x||!x.length)&&Et(Sm,{values:x,onRemoveItem:M}),!S&&Et("input",{value:C,type:"text",placeholder:i,onInput:e=>{f(e.target.value)},onFocus:()=>{u||b(!0)},onBlur:()=>{n.includes(p)&&d(p)},ref:w,readOnly:m||!s})]}),a&&Et("span",{className:"vm-text-field__label",children:a}),l&&t&&Et("div",{className:"vm-select-input__icon",onClick:(e=>t=>{M(e),t.stopPropagation()})(""),children:Et(Ln,{})}),Et("div",{className:wr()({"vm-select-input__icon":!0,"vm-select-input__icon_open":_}),children:Et(jn,{})})]}),Et(Ci,{label:a,value:E,options:n.map((e=>({value:e}))),anchor:v,selected:x,minLength:1,fullWidth:!0,noOptionsText:o,onSelect:M,onOpenAutocomplete:b,onChangeWrapperRef:y})]})},Em=lt.map((e=>e.id)),Nm=e=>{let{jobs:t,instances:n,names:a,job:i,instance:o,size:l,selectedMetrics:s,onChangeJob:c,onChangeInstance:u,onToggleMetric:d,onChangeSize:h}=e;const m=(0,r.useMemo)((()=>i?"":"No instances. Please select job"),[i]),p=(0,r.useMemo)((()=>i?"":"No metric names. Please select job"),[i]),{isMobile:f}=Ur(),{value:v,toggle:g,setFalse:y}=na("false"!==Xe("EXPLORE_METRICS_TIPS"));return(0,r.useEffect)((()=>{Je("EXPLORE_METRICS_TIPS","".concat(v))}),[v]),Et(St.FK,{children:[Et("div",{className:wr()({"vm-explore-metrics-header":!0,"vm-explore-metrics-header_mobile":f,"vm-block":!0,"vm-block_mobile":f}),children:[Et("div",{className:"vm-explore-metrics-header__job",children:Et(Cm,{value:i,list:t,label:"Job",placeholder:"Please select job",onChange:c,autofocus:!i&&!!t.length&&!f,searchable:!0})}),Et("div",{className:"vm-explore-metrics-header__instance",children:Et(Cm,{value:o,list:n,label:"Instance",placeholder:"Please select instance",onChange:u,noOptionsText:m,clearable:!0,searchable:!0})}),Et("div",{className:"vm-explore-metrics-header__size",children:[Et(Cm,{label:"Size graphs",value:l,list:Em,onChange:h}),Et(da,{title:"".concat(v?"Hide":"Show"," tip"),children:Et(ea,{variant:"text",color:v?"warning":"gray",startIcon:Et(dr,{}),onClick:g,ariaLabel:"visibility tips"})})]}),Et("div",{className:"vm-explore-metrics-header-metrics",children:Et(Cm,{label:"Metrics",value:s,list:a,placeholder:"Search metric name",onChange:d,noOptionsText:p,clearable:!0,searchable:!0})})]}),v&&Et(qr,{variant:"warning",children:Et("div",{className:"vm-explore-metrics-header-description",children:[Et("p",{children:["Please note: this page is solely designed for exploring Prometheus metrics. Prometheus metrics always contain ",Et("code",{children:"job"})," and ",Et("code",{children:"instance"})," labels (see ",Et("a",{className:"vm-link vm-link_colored",href:"https://prometheus.io/docs/concepts/jobs_instances/",children:"these docs"}),"), and this page relies on them as filters. ",Et("br",{}),"Please use this page for Prometheus metrics only, in accordance with their naming conventions."]}),Et(ea,{variant:"text",size:"small",startIcon:Et(Ln,{}),onClick:y,ariaLabel:"close tips"})]})})]})},Am=ct("job",""),Mm=ct("instance",""),Tm=ct("metrics",""),Lm=ct("size",""),Pm=lt.find((e=>Lm?e.id===Lm:e.isDefault))||lt[0],Om=()=>{const[e,t]=(0,r.useState)(Am),[n,a]=(0,r.useState)(Mm),[i,o]=(0,r.useState)(Tm?Tm.split("&"):[]),[l,s]=(0,r.useState)(Pm);(e=>{let{job:t,instance:n,metrics:a,size:i}=e;const{duration:o,relativeTime:l,period:{date:s}}=pn(),{customStep:c}=jr(),{setSearchParamsFromKeys:u}=ei(),d=()=>{const e=Mh({"g0.range_input":o,"g0.end_input":s,"g0.step_input":c,"g0.relative_time":l,size:i,job:t,instance:n,metrics:a});u(e)};(0,r.useEffect)(d,[o,l,s,c,t,n,a,i]),(0,r.useEffect)(d,[])})({job:e,instance:n,metrics:i.join("&"),size:l.id});const{jobs:c,isLoading:u,error:d}=(()=>{const{serverUrl:e}=At(),{period:t}=pn(),[n,a]=(0,r.useState)([]),[i,o]=(0,r.useState)(!1),[l,s]=(0,r.useState)(),c=(0,r.useMemo)((()=>((e,t)=>"".concat(e,"/api/v1/label/job/values?start=").concat(t.start,"&end=").concat(t.end))(e,t)),[e,t]);return(0,r.useEffect)((()=>{(async()=>{o(!0);try{const e=await fetch(c),t=await e.json(),n=t.data||[];a(n.sort(((e,t)=>e.localeCompare(t)))),e.ok?s(void 0):s("".concat(t.errorType,"\r\n").concat(null===t||void 0===t?void 0:t.error))}catch(ep){ep instanceof Error&&s("".concat(ep.name,": ").concat(ep.message))}o(!1)})().catch(console.error)}),[c]),{jobs:n,isLoading:i,error:l}})(),{instances:h,isLoading:m,error:p}=_m(e),{names:f,isLoading:v,error:g}=bm(e,n),y=(0,r.useMemo)((()=>u||m||v),[u,m,v]),_=(0,r.useMemo)((()=>d||p||g),[d,p,g]),b=e=>{o(e?t=>t.includes(e)?t.filter((t=>t!==e)):[...t,e]:[])},w=(e,t,n)=>{const r=n>i.length-1;n<0||r||o((e=>{const r=[...e],[a]=r.splice(t,1);return r.splice(n,0,a),r}))};return(0,r.useEffect)((()=>{n&&h.length&&!h.includes(n)&&a("")}),[h,n]),Et("div",{className:"vm-explore-metrics",children:[Et(Nm,{jobs:c,instances:h,names:f,job:e,size:l.id,instance:n,selectedMetrics:i,onChangeJob:t,onChangeSize:e=>{const t=lt.find((t=>t.id===e));t&&s(t)},onChangeInstance:a,onToggleMetric:b}),y&&Et(Bo,{}),_&&Et(qr,{variant:"error",children:_}),!e&&Et(qr,{variant:"info",children:"Please select job to see list of metric names."}),e&&!i.length&&Et(qr,{variant:"info",children:"Please select metric names to see the graphs."}),Et("div",{className:"vm-explore-metrics-body",children:i.map(((t,r)=>Et(xm,{name:t,job:e,instance:n,index:r,length:i.length,size:l,onRemoveItem:b,onChangeOrder:w},t)))})]})},Im=()=>{const t=Fo();return Et("div",{className:"vm-preview-icons",children:Object.entries(e).map((e=>{let[n,r]=e;return Et("div",{className:"vm-preview-icons-item",onClick:(a=n,async()=>{await t("<".concat(a,"/>"),"<".concat(a,"/> has been copied"))}),children:[Et("div",{className:"vm-preview-icons-item__svg",children:r()}),Et("div",{className:"vm-preview-icons-item__name",children:"<".concat(n,"/>")})]},n);var a}))})};var Rm=function(e){return e.copy="Copy",e.copied="Copied",e}(Rm||{});const Dm=e=>{let{code:t}=e;const[n,a]=(0,r.useState)(Rm.copy);return(0,r.useEffect)((()=>{let e=null;return n===Rm.copied&&(e=setTimeout((()=>a(Rm.copy)),1e3)),()=>{e&&clearTimeout(e)}}),[n]),Et("code",{className:"vm-code-example",children:[t,Et("div",{className:"vm-code-example__copy",children:Et(da,{title:n,children:Et(ea,{size:"small",variant:"text",onClick:()=>{navigator.clipboard.writeText(t),a(Rm.copied)},startIcon:Et(nr,{}),ariaLabel:"close"})})})]})},zm=()=>Et("a",{className:"vm-link vm-link_colored",href:"https://docs.victoriametrics.com/MetricsQL.html",target:"_blank",rel:"help noreferrer",children:"MetricsQL"}),Fm=()=>Et("a",{className:"vm-link vm-link_colored",href:"https://grafana.com/grafana/dashboards/1860-node-exporter-full/",target:"_blank",rel:"help noreferrer",children:"Node Exporter Full"}),jm=()=>Et("section",{className:"vm-with-template-tutorial",children:[Et("h2",{className:"vm-with-template-tutorial__title",children:["Tutorial for WITH expressions in ",Et(zm,{})]}),Et("div",{className:"vm-with-template-tutorial-section",children:[Et("p",{className:"vm-with-template-tutorial-section__text",children:["Let's look at the following real query from ",Et(Fm,{})," dashboard:"]}),Et(Dm,{code:'(\n (\n node_memory_MemTotal_bytes{instance=~"$node:$port", job=~"$job"}\n -\n node_memory_MemFree_bytes{instance=~"$node:$port", job=~"$job"}\n )\n /\n node_memory_MemTotal_bytes{instance=~"$node:$port", job=~"$job"}\n) * 100'}),Et("p",{className:"vm-with-template-tutorial-section__text",children:"It is clear the query calculates the percentage of used memory for the given $node, $port and $job. Isn't it? :)"})]}),Et("div",{className:"vm-with-template-tutorial-section",children:[Et("p",{className:"vm-with-template-tutorial-section__text",children:"What's wrong with this query? Copy-pasted label filters for distinct timeseries which makes it easy to mistype these filters during modification. Let's simplify the query with WITH expressions:"}),Et(Dm,{code:'WITH (\n commonFilters = {instance=~"$node:$port",job=~"$job"}\n)\n(\n node_memory_MemTotal_bytes{commonFilters}\n -\n node_memory_MemFree_bytes{commonFilters}\n)\n /\nnode_memory_MemTotal_bytes{commonFilters} * 100'})]}),Et("div",{className:"vm-with-template-tutorial-section",children:[Et("p",{className:"vm-with-template-tutorial-section__text",children:["Now label filters are located in a single place instead of three distinct places. The query mentions node_memory_MemTotal_bytes metric twice and ","{commonFilters}"," three times. WITH expressions may improve this:"]}),Et(Dm,{code:'WITH (\n my_resource_utilization(free, limit, filters) = (limit{filters} - free{filters}) / limit{filters} * 100\n)\nmy_resource_utilization(\n node_memory_MemFree_bytes,\n node_memory_MemTotal_bytes,\n {instance=~"$node:$port",job=~"$job"},\n)'}),Et("p",{className:"vm-with-template-tutorial-section__text",children:"Now the template function my_resource_utilization() may be used for monitoring arbitrary resources - memory, CPU, network, storage, you name it."})]}),Et("div",{className:"vm-with-template-tutorial-section",children:[Et("p",{className:"vm-with-template-tutorial-section__text",children:["Let's take another nice query from ",Et(Fm,{})," dashboard:"]}),Et(Dm,{code:'(\n (\n (\n count(\n count(node_cpu_seconds_total{instance=~"$node:$port",job=~"$job"}) by (cpu)\n )\n )\n -\n avg(\n sum by (mode) (rate(node_cpu_seconds_total{mode=\'idle\',instance=~"$node:$port",job=~"$job"}[5m]))\n )\n )\n *\n 100\n)\n /\ncount(\n count(node_cpu_seconds_total{instance=~"$node:$port",job=~"$job"}) by (cpu)\n)'}),Et("p",{className:"vm-with-template-tutorial-section__text",children:"Do you understand what does this mess do? Is it manageable? :) WITH expressions are happy to help in a few iterations."})]}),Et("div",{className:"vm-with-template-tutorial-section",children:[Et("p",{className:"vm-with-template-tutorial-section__text",children:"1. Extract common filters used in multiple places into a commonFilters variable:"}),Et(Dm,{code:'WITH (\n commonFilters = {instance=~"$node:$port",job=~"$job"}\n)\n(\n (\n (\n count(\n count(node_cpu_seconds_total{commonFilters}) by (cpu)\n )\n )\n -\n avg(\n sum by (mode) (rate(node_cpu_seconds_total{mode=\'idle\',commonFilters}[5m]))\n )\n )\n *\n 100\n)\n /\ncount(\n count(node_cpu_seconds_total{commonFilters}) by (cpu)\n)'})]}),Et("div",{className:"vm-with-template-tutorial-section",children:[Et("p",{className:"vm-with-template-tutorial-section__text",children:'2. Extract "count(count(...) by (cpu))" into cpuCount variable:'}),Et(Dm,{code:'WITH (\n commonFilters = {instance=~"$node:$port",job=~"$job"},\n cpuCount = count(count(node_cpu_seconds_total{commonFilters}) by (cpu))\n)\n(\n (\n cpuCount\n -\n avg(\n sum by (mode) (rate(node_cpu_seconds_total{mode=\'idle\',commonFilters}[5m]))\n )\n )\n *\n 100\n) / cpuCount'})]}),Et("div",{className:"vm-with-template-tutorial-section",children:[Et("p",{className:"vm-with-template-tutorial-section__text",children:"3. Extract rate(...) part into cpuIdle variable, since it is clear now that this part calculates the number of idle CPUs:"}),Et(Dm,{code:'WITH (\n commonFilters = {instance=~"$node:$port",job=~"$job"},\n cpuCount = count(count(node_cpu_seconds_total{commonFilters}) by (cpu)),\n cpuIdle = sum(rate(node_cpu_seconds_total{mode=\'idle\',commonFilters}[5m]))\n)\n((cpuCount - cpuIdle) * 100) / cpuCount'})]}),Et("div",{className:"vm-with-template-tutorial-section",children:[Et("p",{className:"vm-with-template-tutorial-section__text",children:["4. Put node_cpu_seconds_total","{commonFilters}"," into its own varialbe with the name cpuSeconds:"]}),Et(Dm,{code:'WITH (\n cpuSeconds = node_cpu_seconds_total{instance=~"$node:$port",job=~"$job"},\n cpuCount = count(count(cpuSeconds) by (cpu)),\n cpuIdle = sum(rate(cpuSeconds{mode=\'idle\'}[5m]))\n)\n((cpuCount - cpuIdle) * 100) / cpuCount'}),Et("p",{className:"vm-with-template-tutorial-section__text",children:"Now the query became more clear comparing to the initial query."})]}),Et("div",{className:"vm-with-template-tutorial-section",children:[Et("p",{className:"vm-with-template-tutorial-section__text",children:"WITH expressions may be nested and may be put anywhere. Try expanding the following query:"}),Et(Dm,{code:"WITH (\n f(a, b) = WITH (\n f1(x) = b-x,\n f2(x) = x+x\n ) f1(a)*f2(b)\n) f(foo, with(x=bar) x)"})]})]}),Hm=()=>{const{serverUrl:e}=At(),[t,n]=je(),[a,i]=(0,r.useState)(""),[o,l]=(0,r.useState)(!1),[s,c]=(0,r.useState)();return{data:a,error:s,loading:o,expand:async r=>{t.set("expr",r),n(t);const a=((e,t)=>"".concat(e,"/expand-with-exprs?query=").concat(encodeURIComponent(t),"&format=json"))(e,r);l(!0);try{const e=await fetch(a),t=await e.json();i((null===t||void 0===t?void 0:t.expr)||""),c(String(t.error||""))}catch(ep){ep instanceof Error&&"AbortError"!==ep.name&&c("".concat(ep.name,": ").concat(ep.message))}l(!1)}}},Vm=()=>{const[e]=je(),{data:t,loading:n,error:a,expand:i}=Hm(),[o,l]=(0,r.useState)(e.get("expr")||""),s=()=>{i(o)};return(0,r.useEffect)((()=>{o&&i(o)}),[]),Et("section",{className:"vm-with-template",children:[n&&Et(Bo,{}),Et("div",{className:"vm-with-template-body vm-block",children:[Et("div",{className:"vm-with-template-body__expr",children:Et(Da,{type:"textarea",label:"MetricsQL query with optional WITH expressions",value:o,error:a,autofocus:!0,onEnter:s,onChange:e=>{l(e)}})}),Et("div",{className:"vm-with-template-body__result",children:Et(Da,{type:"textarea",label:"MetricsQL query after expanding WITH expressions and applying other optimizations",value:t,disabled:!0})}),Et("div",{className:"vm-with-template-body-top",children:Et(ea,{variant:"contained",onClick:s,startIcon:Et(Bn,{}),children:"Expand"})})]}),Et("div",{className:"vm-block",children:Et(jm,{})})]})},$m=()=>{const{serverUrl:e}=At(),[t,n]=(0,r.useState)(null),[a,i]=(0,r.useState)(!1),[o,l]=(0,r.useState)();return{data:t,error:o,loading:a,fetchData:async(t,r)=>{const a=((e,t,n)=>{const r=["format=json","relabel_configs=".concat(encodeURIComponent(t)),"metric=".concat(encodeURIComponent(n))];return"".concat(e,"/metric-relabel-debug?").concat(r.join("&"))})(e,t,r);i(!0);try{const e=await fetch(a),t=await e.json();n(t.error?null:t),l(String(t.error||""))}catch(ep){ep instanceof Error&&"AbortError"!==ep.name&&l("".concat(ep.name,": ").concat(ep.message))}i(!1)}}},Um={config:'- if: \'{bar_label=~"b.*"}\'\n source_labels: [foo_label, bar_label]\n separator: "_"\n target_label: foobar\n- action: labeldrop\n regex: "foo_.*"\n- target_label: job\n replacement: "my-application-2"',labels:'{__name__="my_metric", bar_label="bar", foo_label="foo", job="my-application", instance="192.168.0.1"}'},Bm=()=>{const[e,t]=je(),{data:n,loading:a,error:i,fetchData:o}=$m(),[l,s]=$h("","config"),[c,u]=$h("","labels"),d=(0,r.useCallback)((()=>{o(l,c),e.set("config",l),e.set("labels",c),t(e)}),[l,c]);return(0,r.useEffect)((()=>{const t=e.get("config")||"",n=e.get("labels")||"";(n||t)&&(o(t,n),s(t),u(n))}),[]),Et("section",{className:"vm-relabeling",children:[a&&Et(Bo,{}),Et("div",{className:"vm-relabeling-header vm-block",children:[Et("div",{className:"vm-relabeling-header-configs",children:Et(Da,{type:"textarea",label:"Relabel configs",value:l,autofocus:!0,onChange:e=>{s(e||"")},onEnter:d})}),Et("div",{className:"vm-relabeling-header__labels",children:Et(Da,{type:"textarea",label:"Labels",value:c,onChange:e=>{u(e||"")},onEnter:d})}),Et("div",{className:"vm-relabeling-header-bottom",children:[Et("a",{className:"vm-link vm-link_with-icon",target:"_blank",href:"https://docs.victoriametrics.com/relabeling.html",rel:"help noreferrer",children:[Et(On,{}),"Relabeling cookbook"]}),Et("a",{className:"vm-link vm-link_with-icon",target:"_blank",href:"https://docs.victoriametrics.com/vmagent.html#relabeling",rel:"help noreferrer",children:[Et(ir,{}),"Documentation"]}),Et(ea,{variant:"text",onClick:()=>{const{config:n,labels:r}=Um;s(n),u(r),o(n,r),e.set("config",n),e.set("labels",r),t(e)},children:"Try example"}),Et(ea,{variant:"contained",onClick:d,startIcon:Et(Bn,{}),children:"Submit"})]})]}),i&&Et(qr,{variant:"error",children:i}),n&&Et("div",{className:"vm-relabeling-steps vm-block",children:[n.originalLabels&&Et("div",{className:"vm-relabeling-steps-item",children:Et("div",{className:"vm-relabeling-steps-item__row",children:[Et("span",{children:"Original labels:"}),Et("code",{dangerouslySetInnerHTML:{__html:n.originalLabels}})]})}),n.steps.map(((e,t)=>Et("div",{className:"vm-relabeling-steps-item",children:[Et("div",{className:"vm-relabeling-steps-item__row",children:[Et("span",{children:"Step:"}),t+1]}),Et("div",{className:"vm-relabeling-steps-item__row",children:[Et("span",{children:"Relabeling Rule:"}),Et("code",{children:Et("pre",{children:e.rule})})]}),Et("div",{className:"vm-relabeling-steps-item__row",children:[Et("span",{children:"Input Labels:"}),Et("code",{children:Et("pre",{dangerouslySetInnerHTML:{__html:e.inLabels}})})]}),Et("div",{className:"vm-relabeling-steps-item__row",children:[Et("span",{children:"Output labels:"}),Et("code",{children:Et("pre",{dangerouslySetInnerHTML:{__html:e.outLabels}})})]})]},t))),n.resultingLabels&&Et("div",{className:"vm-relabeling-steps-item",children:Et("div",{className:"vm-relabeling-steps-item__row",children:[Et("span",{children:"Resulting labels:"}),Et("code",{dangerouslySetInnerHTML:{__html:n.resultingLabels}})]})})]})]})},qm=e=>{let{rows:t,columns:n,defaultOrderBy:a,copyToClipboard:i,paginationOffset:o}=e;const[l,s]=(0,r.useState)(a),[c,u]=(0,r.useState)("desc"),[d,h]=(0,r.useState)(null),m=(0,r.useMemo)((()=>{const{startIndex:e,endIndex:n}=o;return Kh(t,Wh(c,l)).slice(e,n)}),[t,l,c,o]),p=(e,t)=>async()=>{if(d!==t)try{await navigator.clipboard.writeText(String(e)),h(t)}catch(ep){console.error(ep)}};return(0,r.useEffect)((()=>{if(null===d)return;const e=setTimeout((()=>h(null)),2e3);return()=>clearTimeout(e)}),[d]),Et("table",{className:"vm-table",children:[Et("thead",{className:"vm-table-header",children:Et("tr",{className:"vm-table__row vm-table__row_header",children:[n.map((e=>{return Et("th",{className:"vm-table-cell vm-table-cell_header vm-table-cell_sort",onClick:(t=e.key,()=>{u((e=>"asc"===e&&l===t?"desc":"asc")),s(t)}),children:Et("div",{className:"vm-table-cell__content",children:[Et("div",{children:String(e.title||e.key)}),Et("div",{className:wr()({"vm-table__sort-icon":!0,"vm-table__sort-icon_active":l===e.key,"vm-table__sort-icon_desc":"desc"===c&&l===e.key}),children:Et(jn,{})})]})},String(e.key));var t})),i&&Et("th",{className:"vm-table-cell vm-table-cell_header"})]})}),Et("tbody",{className:"vm-table-body",children:m.map(((e,t)=>Et("tr",{className:"vm-table__row",children:[n.map((t=>Et("td",{className:wr()({"vm-table-cell":!0,["".concat(t.className)]:t.className}),children:e[t.key]||"-"},String(t.key)))),i&&Et("td",{className:"vm-table-cell vm-table-cell_right",children:e[i]&&Et("div",{className:"vm-table-cell__content",children:Et(da,{title:d===t?"Copied":"Copy row",children:Et(ea,{variant:"text",color:d===t?"success":"gray",size:"small",startIcon:Et(d===t?Jn:nr,{}),onClick:p(e[i],t),ariaLabel:"copy row"})})})})]},t)))})]})},Ym=()=>{const{isMobile:e}=Ur(),{timezone:t}=pn(),{data:n,lastUpdated:a,isLoading:o,error:l,fetchData:s}=(()=>{const{serverUrl:e}=At(),[t,n]=(0,r.useState)([]),[a,o]=(0,r.useState)(i()().format(Ot)),[l,s]=(0,r.useState)(!1),[c,u]=(0,r.useState)(),d=(0,r.useMemo)((()=>"".concat(e,"/api/v1/status/active_queries")),[e]),h=async()=>{s(!0);try{const e=await fetch(d),t=await e.json();n(t.data),o(i()().format("HH:mm:ss:SSS")),e.ok?u(void 0):u("".concat(t.errorType,"\r\n").concat(null===t||void 0===t?void 0:t.error))}catch(ep){ep instanceof Error&&u("".concat(ep.name,": ").concat(ep.message))}s(!1)};return(0,r.useEffect)((()=>{h().catch(console.error)}),[d]),{data:t,lastUpdated:a,isLoading:l,error:c,fetchData:h}})(),c=(0,r.useMemo)((()=>n.map((e=>{const t=i()(e.start).tz().format(Pt),n=i()(e.end).tz().format(Pt);return{duration:e.duration,remote_addr:e.remote_addr,query:e.query,args:"".concat(t," to ").concat(n,", step=").concat(Yt(e.step)),data:JSON.stringify(e,null,2)}}))),[n,t]),u=(0,r.useMemo)((()=>{if(null===c||void 0===c||!c.length)return[];const e=Object.keys(c[0]),t={remote_addr:"client address"},n=["data"];return e.filter((e=>!n.includes(e))).map((e=>({key:e,title:t[e]||e})))}),[c]);return Et("div",{className:"vm-active-queries",children:[o&&Et(Bo,{}),Et("div",{className:"vm-active-queries-header",children:[!c.length&&!l&&Et(qr,{variant:"info",children:"There are currently no active queries running"}),l&&Et(qr,{variant:"error",children:l}),Et("div",{className:"vm-active-queries-header-controls",children:[Et(ea,{variant:"contained",onClick:async()=>{s().catch(console.error)},startIcon:Et(zn,{}),children:"Update"}),Et("div",{className:"vm-active-queries-header__update-msg",children:["Last updated: ",a]})]})]}),!!c.length&&Et("div",{className:wr()({"vm-block":!0,"vm-block_mobile":e}),children:Et(qm,{rows:c,columns:u,defaultOrderBy:"duration",copyToClipboard:"data",paginationOffset:{startIndex:0,endIndex:1/0}})})]})},Wm=e=>{let{onClose:t,onUpload:n}=e;const{isMobile:a}=Ur(),[i,o]=(0,r.useState)(""),[l,s]=(0,r.useState)(""),c=(0,r.useMemo)((()=>{try{return JSON.parse(i),""}catch(ep){return ep instanceof Error?ep.message:"Unknown error"}}),[i]),u=()=>{s(c),c||(n(i),t())};return Et("div",{className:wr()({"vm-json-form vm-json-form_one-field":!0,"vm-json-form_mobile vm-json-form_one-field_mobile":a}),children:[Et(Da,{value:i,label:"JSON",type:"textarea",error:l,autofocus:!0,onChange:e=>{s(""),o(e)},onEnter:u}),Et("div",{className:"vm-json-form-footer",children:Et("div",{className:"vm-json-form-footer__controls vm-json-form-footer__controls_right",children:[Et(ea,{variant:"outlined",color:"error",onClick:t,children:"Cancel"}),Et(ea,{variant:"contained",onClick:u,children:"apply"})]})})]})},Km=e=>{let{data:t,period:n}=e;const{isMobile:a}=Ur(),{tableCompact:i}=Ir(),o=Rr(),[l,s]=(0,r.useState)([]),[c,u]=(0,r.useState)(),[d,h]=(0,r.useState)(),[m,p]=(0,r.useState)(!1),[f,v]=(0,r.useState)([]),[g,y]=(0,r.useState)(),_=(0,r.useMemo)((()=>fh(d||[]).map((e=>e.key))),[d]),b=(0,r.useMemo)((()=>{const e=t.some((e=>"matrix"===e.data.resultType));return t.some((e=>"vector"===e.data.resultType))&&e?Nr:e?Nr.filter((e=>"chart"===e.value)):Nr.filter((e=>"chart"!==e.value))}),[t]),[w,k]=(0,r.useState)(b[0].value),{yaxis:x,spanGaps:S}=jr(),C=Hr(),E=e=>{C({type:"SET_YAXIS_LIMITS",payload:e})};return(0,r.useEffect)((()=>{const e="chart"===w?"matrix":"vector",n=t.filter((t=>t.data.resultType===e&&t.trace)).map((e=>{var t,n;return e.trace?new Ko(e.trace,(null===e||void 0===e||null===(t=e.vmui)||void 0===t||null===(n=t.params)||void 0===n?void 0:n.query)||"Query"):null}));s(n.filter(Boolean))}),[t,w]),(0,r.useEffect)((()=>{const e=[],n=[],r=[];t.forEach(((t,a)=>{const i=t.data.result.map((e=>{var n,r,i;return{...e,group:Number(null!==(n=null===(r=t.vmui)||void 0===r||null===(i=r.params)||void 0===i?void 0:i.id)&&void 0!==n?n:a)+1}}));var o,l;"matrix"===t.data.resultType?(n.push(...i),e.push((null===(o=t.vmui)||void 0===o||null===(l=o.params)||void 0===l?void 0:l.query)||"Query")):r.push(...i)})),v(e),u(n),h(r)}),[t]),(0,r.useEffect)((()=>{p(!!c&&Go(c))}),[c]),Et("div",{className:wr()({"vm-query-analyzer-view":!0,"vm-query-analyzer-view_mobile":a}),children:[!!l.length&&Et(cl,{traces:l,onDeleteClick:e=>{s((t=>t.filter((t=>t.idValue!==e.idValue))))}}),Et("div",{className:wr()({"vm-block":!0,"vm-block_mobile":a}),children:[Et("div",{className:"vm-custom-panel-body-header",children:[Et("div",{className:"vm-custom-panel-body-header__tabs",children:Et(Er,{activeItem:w,items:b,onChange:e=>{k(e)}})}),Et("div",{className:"vm-custom-panel-body-header__graph-controls",children:["chart"===w&&Et(va,{}),"chart"===w&&Et(hh,{yaxis:x,setYaxisLimits:E,toggleEnableLimits:()=>{C({type:"TOGGLE_ENABLE_YAXIS_LIMITS"})},spanGaps:{value:S,onChange:e=>{C({type:"SET_SPAN_GAPS",payload:e})}}}),"table"===w&&Et(bh,{columns:_,defaultColumns:g,onChangeColumns:y,tableCompact:i,toggleTableCompact:()=>{o({type:"TOGGLE_TABLE_COMPACT"})}})]})]}),c&&n&&"chart"===w&&Et(sh,{data:c,period:n,customStep:n.step||"1s",query:f,yaxis:x,setYaxisLimits:E,setPeriod:()=>null,height:a?.5*window.innerHeight:500,isHistogram:m,spanGaps:S}),d&&"code"===w&&Et(ph,{data:d}),d&&"table"===w&&Et(gh,{data:d,displayColumns:g})]})]})},Qm=e=>{var t,n;let{data:a,period:o}=e;const l=(0,r.useMemo)((()=>a.filter((e=>e.stats&&"matrix"===e.data.resultType))),[a]),s=(0,r.useMemo)((()=>{var e,t;return null===(e=a.find((e=>{var t;return null===e||void 0===e||null===(t=e.vmui)||void 0===t?void 0:t.comment})))||void 0===e||null===(t=e.vmui)||void 0===t?void 0:t.comment}),[a]),c=(0,r.useMemo)((()=>{if(!o)return"";const e=i()(1e3*o.start).tz().format(Pt),t=i()(1e3*o.end).tz().format(Pt);return"".concat(e," - ").concat(t)}),[o]),{value:u,setTrue:d,setFalse:h}=na(!1);return Et(St.FK,{children:[Et("div",{className:"vm-query-analyzer-info-header",children:[Et(ea,{startIcon:Et(On,{}),variant:"outlined",color:"warning",onClick:d,children:"Show report info"}),o&&Et(St.FK,{children:[Et("div",{className:"vm-query-analyzer-info-header__period",children:[Et(ar,{})," step: ",o.step]}),Et("div",{className:"vm-query-analyzer-info-header__period",children:[Et(Hn,{})," ",c]})]})]}),u&&Et(ua,{title:"Report info",onClose:h,children:Et("div",{className:"vm-query-analyzer-info",children:[s&&Et("div",{className:"vm-query-analyzer-info-item vm-query-analyzer-info-item_comment",children:[Et("div",{className:"vm-query-analyzer-info-item__title",children:"Comment:"}),Et("div",{className:"vm-query-analyzer-info-item__text",children:s})]}),l.map(((e,t)=>{var n;return Et("div",{className:"vm-query-analyzer-info-item",children:[Et("div",{className:"vm-query-analyzer-info-item__title",children:l.length>1?"Query ".concat(t+1,":"):"Stats:"}),Et("div",{className:"vm-query-analyzer-info-item__text",children:[Object.entries(e.stats||{}).map((e=>{let[t,n]=e;return Et("div",{children:[t,": ",null!==n&&void 0!==n?n:"-"]},t)})),"isPartial: ",String(null!==(n=e.isPartial)&&void 0!==n?n:"-")]})]},t)})),Et("div",{className:"vm-query-analyzer-info-type",children:null!==(t=l[0])&&void 0!==t&&null!==(n=t.vmui)&&void 0!==n&&n.params?"The report was created using vmui":"The report was created manually"})]})})]})},Zm=()=>{const[e,t]=(0,r.useState)([]),[n,a]=(0,r.useState)(""),i=(0,r.useMemo)((()=>!!e.length),[e]),{value:o,setTrue:l,setFalse:s}=na(!1),c=(0,r.useMemo)((()=>{var t,n;if(!e)return;const r=null===(t=e[0])||void 0===t||null===(n=t.vmui)||void 0===n?void 0:n.params,a={start:+((null===r||void 0===r?void 0:r.start)||0),end:+((null===r||void 0===r?void 0:r.end)||0),step:null===r||void 0===r?void 0:r.step,date:""};if(!r){const t=e.filter((e=>"matrix"===e.data.resultType)).map((e=>e.data.result)).flat().map((e=>{var t;return e.values?null===(t=e.values)||void 0===t?void 0:t.map((e=>e[0])):[0]})).flat(),n=Array.from(new Set(t.filter(Boolean))).sort(((e,t)=>e-t));a.start=n[0],a.end=n[n.length-1],a.step=qt((e=>{const t=e.slice(1).map(((t,n)=>t-e[n])),n={};t.forEach((e=>{const t=e.toString();n[t]=(n[t]||0)+1}));let r=0,a=0;for(const i in n)n[i]>a&&(a=n[i],r=Number(i));return r})(n))}return a.date=Gt(en(a.end)),a}),[e]),u=e=>{try{const n=JSON.parse(e),r=Array.isArray(n)?n:[n];(e=>e.every((e=>{if("object"===typeof e&&null!==e){const t=e.data;if("object"===typeof t&&null!==t){const e=t.result,n=t.resultType;return Array.isArray(e)&&"string"===typeof n}}return!1})))(r)?t(r):a("Invalid structure - JSON does not match the expected format")}catch(ep){ep instanceof Error&&a("".concat(ep.name,": ").concat(ep.message))}},d=e=>{e.map((e=>{const t=new FileReader;t.onload=e=>{var t;const n=String(null===(t=e.target)||void 0===t?void 0:t.result);u(n)},t.readAsText(e)}))},h=e=>{a("");const t=Array.from(e.target.files||[]);d(t),e.target.value=""},{files:m,dragging:p}=vm();return(0,r.useEffect)((()=>{d(m)}),[m]),Et("div",{className:"vm-trace-page",children:[i&&Et("div",{className:"vm-trace-page-header",children:[Et("div",{className:"vm-trace-page-header-errors",children:Et(Qm,{data:e,period:c})}),Et("div",{children:Et(gm,{onOpenModal:l,onChange:h})})]}),n&&Et("div",{className:"vm-trace-page-header-errors-item vm-trace-page-header-errors-item_margin-bottom",children:[Et(qr,{variant:"error",children:n}),Et(ea,{className:"vm-trace-page-header-errors-item__close",startIcon:Et(Ln,{}),variant:"text",color:"error",onClick:()=>{a("")}})]}),i&&Et(Km,{data:e,period:c}),!i&&Et("div",{className:"vm-trace-page-preview",children:[Et("p",{className:"vm-trace-page-preview__text",children:["Please, upload file with JSON response content.","\n","The file must contain query information in JSON format.","\n","Graph will be displayed after file upload.","\n","Attach files by dragging & dropping, selecting or pasting them."]}),Et(gm,{onOpenModal:l,onChange:h})]}),o&&Et(ua,{title:"Paste JSON",onClose:s,children:Et(Wm,{onClose:s,onUpload:u})}),p&&Et("div",{className:"vm-trace-page__dropzone"})]})},Gm=()=>{const[e,t]=(0,r.useState)(!1);return Et(St.FK,{children:Et(Le,{children:Et(Gr,{children:Et(St.FK,{children:[Et(fm,{onLoaded:t}),e&&Et(ke,{children:Et(be,{path:"/",element:Et(xi,{}),children:[Et(be,{path:Ye.home,element:Et(Eh,{})}),Et(be,{path:Ye.metrics,element:Et(Om,{})}),Et(be,{path:Ye.cardinality,element:Et(am,{})}),Et(be,{path:Ye.topQueries,element:Et(um,{})}),Et(be,{path:Ye.trace,element:Et(ym,{})}),Et(be,{path:Ye.queryAnalyzer,element:Et(Zm,{})}),Et(be,{path:Ye.dashboards,element:Et(Th,{})}),Et(be,{path:Ye.withTemplate,element:Et(Vm,{})}),Et(be,{path:Ye.relabel,element:Et(Bm,{})}),Et(be,{path:Ye.activeQueries,element:Et(Ym,{})}),Et(be,{path:Ye.icons,element:Et(Im,{})})]})})]})})})})},Jm=e=>{e&&n.e(685).then(n.bind(n,685)).then((t=>{let{getCLS:n,getFID:r,getFCP:a,getLCP:i,getTTFB:o}=t;n(e),r(e),a(e),i(e),o(e)}))},Xm=document.getElementById("root");Xm&&(0,r.render)(Et(Gm,{}),Xm),Jm()})()})();
\ No newline at end of file
diff --git a/app/vmselect/vmui/static/js/main.59c17910.js.LICENSE.txt b/app/vmselect/vmui/static/js/main.ff9af61b.js.LICENSE.txt
similarity index 100%
rename from app/vmselect/vmui/static/js/main.59c17910.js.LICENSE.txt
rename to app/vmselect/vmui/static/js/main.ff9af61b.js.LICENSE.txt
diff --git a/app/vmselect/vmui/static/media/MetricsQL.df7574389d8f8bbcf0c7.md b/app/vmselect/vmui/static/media/MetricsQL.cb83d071da309a358bc0.md
similarity index 99%
rename from app/vmselect/vmui/static/media/MetricsQL.df7574389d8f8bbcf0c7.md
rename to app/vmselect/vmui/static/media/MetricsQL.cb83d071da309a358bc0.md
index fec10e5dc..158b0725f 100644
--- a/app/vmselect/vmui/static/media/MetricsQL.df7574389d8f8bbcf0c7.md
+++ b/app/vmselect/vmui/static/media/MetricsQL.cb83d071da309a358bc0.md
@@ -328,6 +328,7 @@ See also [increases_over_time](#increases_over_time).
`default_rollup(series_selector[d])` is a [rollup function](#rollup-functions), which returns the last [raw sample](https://docs.victoriametrics.com/keyconcepts/#raw-samples)
value on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering).
+Compared to [last_over_time](#last_over_time) it accounts for [staleness markers](https://docs.victoriametrics.com/vmagent/#prometheus-staleness-markers) to detect stale series.
If the lookbehind window is skipped in square brackets, then it is automatically calculated as `max(step, scrape_interval)`, where `step` is the query arg value
passed to [/api/v1/query_range](https://docs.victoriametrics.com/keyconcepts/#range-query) or [/api/v1/query](https://docs.victoriametrics.com/keyconcepts/#instant-query),
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index e858090ba..f9093c22e 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -30,6 +30,10 @@ See also [LTS releases](https://docs.victoriametrics.com/lts-releases/).
## tip
+## [v1.102.0-rc1](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.102.0-rc1)
+
+Released at 2024-06-07
+
**Update note 1: the `-remoteWrite.multitenantURL` command-line flag at `vmagent` was removed starting from this release. This flag was deprecated since [v1.96.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.96.0). Use `-enableMultitenantHandlers` instead, as it is easier to use and combine with [multitenant URL at vminsert](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#multitenancy-via-labels). See these [docs for details](https://docs.victoriametrics.com/vmagent.html#multitenancy).**
**Update note 2: the `-streamAggr.dropInputLabels` command-line flag at `vmagent` was renamed to `-remoteWrite.streamAggr.dropInputLabels`. `-streamAggr.dropInputLabels` is now used for global streaming aggregation.**
@@ -51,6 +55,7 @@ See also [LTS releases](https://docs.victoriametrics.com/lts-releases/).
* FEATURE: [vmagent](https://docs.victoriametrics.com/vmagent.html): allow configuring `-remoteWrite.disableOnDiskQueue` and `-remoteWrite.dropSamplesOnOverload` cmd-line flags per each `-remoteWrite.url`. See this [pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/6065). Thanks to @rbizos for implementation!
* FEATURE: [vmagent](https://docs.victoriametrics.com/vmagent.html): add labels `path` and `url` to metrics `vmagent_remotewrite_push_failures_total` and `vmagent_remotewrite_samples_dropped_total`. Now number of failed pushes and dropped samples can be tracked per `-remoteWrite.url`.
* FEATURE: [stream aggregation](https://docs.victoriametrics.com/stream-aggregation/): add [rate_sum](https://docs.victoriametrics.com/stream-aggregation/#rate_sum) and [rate_avg](https://docs.victoriametrics.com/stream-aggregation/#rate_avg) aggregation outputs.
+* FEATURE: [stream aggregation](https://docs.victoriametrics.com/stream-aggregation/): reduce the number of allocated objects in heap during deduplication and aggregation. The change supposed to reduce pressure on Garbage Collector, as it will need to scan less objects. See [this pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/6402).
* FEATURE: [vmalert](https://docs.victoriametrics.com/vmalert/): add `datasource.idleConnTimeout`, `remoteWrite.idleConnTimeout` and `remoteRead.idleConnTimeout` flags. These flags are set to 50s by default and should reduce the probability of `broken pipe` or `connection reset by peer` errors in vmalert logs. See this [issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5661) for details.
* FEATURE: [vmalert](https://docs.victoriametrics.com/vmalert/): add auto request retry for trivial network errors, such as `broken pipe` and `connection reset` for requests to `remoteRead`, `remoteWrite` and `datasource` URLs. See this [issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5661) for details.
* FEATURE: [vmalert](https://docs.victoriametrics.com/vmalert/): reduce CPU usage when evaluating high number of alerting and recording rules.
@@ -59,6 +64,8 @@ See also [LTS releases](https://docs.victoriametrics.com/lts-releases/).
* FEATURE: [vmbackup](https://docs.victoriametrics.com/vmbackup/), [vmrestore](https://docs.victoriametrics.com/vmrestore/), [vmbackupmanager](https://docs.victoriametrics.com/vmbackupmanager/): add `-s3TLSInsecureSkipVerify` command-line flag for skipping TLS certificates verification when connecting to S3 endpoint.
* FEATURE: expose metric `vm_indexdb_items_dropped_total` to track the number of IndexDB records that had to be dropped during ingestion. The reason of dropping the record will be annotated in `reason` label of the exposed metric. This change also comes with a new [alerting rule](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/deployment/docker/alerts-health.yml) to track changes of this metric.
* FEATURE: [alerts-health](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/deployment/docker/alerts-health.yml): add new alerting rules `TooLongLabelValues` and `TooLongLabelNames` to notify about truncation of label values or names respectively.
+* FEATURE: [stream aggregation](https://docs.victoriametrics.com/stream-aggregation/): expose `vm_streamaggr_ignored_samples_total` [counters](https://docs.victoriametrics.com/keyconcepts/#counter) at [`/metrics` page](https://docs.victoriametrics.com/#monitoring), which can be used for detecting amount of too old or NaN valued ignored samples. Expose also `vm_streamaggr_samples_lag_seconds` [histogram](https://docs.victoriametrics.com/keyconcepts/#histogram) to monitor aggregated samples lag.
+* FEATURE: [stream aggregation](https://docs.victoriametrics.com/stream-aggregation/): improve filtering speed of the received data samples if [match](https://docs.victoriametrics.com/stream-aggregation/#stream-aggregation-config) field is matching only [metric name](https://docs.victoriametrics.com/keyconcepts/#structure-of-a-metric).
* BUGFIX: [vmui](https://docs.victoriametrics.com/#vmui): fix bug that prevents the first query trace from expanding on click event. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6186). The issue was introduced in [v1.100.0](https://docs.victoriametrics.com/changelog/#v11000) release.
* BUGFIX: [vmui](https://docs.victoriametrics.com/#vmui): fix calendar display when `UTC+00:00` timezone is set. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6239).
@@ -252,6 +259,28 @@ Released at 2024-02-14
* BUGFIX: [dashboards](https://grafana.com/orgs/victoriametrics): update `Storage full ETA` panels for Single-node and Cluster dashboards to prevent them from showing negative or blank results caused by increase of deduplicated samples. Deduplicated samples were part of the expression to provide a better estimate for disk usage, but due to sporadic nature of [deduplication](https://docs.victoriametrics.com/#deduplication) in VictoriaMetrics it rather produced skewed results. See [this pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/5747).
* BUGFIX: [vmalert](https://docs.victoriametrics.com/#vmalert): reduce memory usage for ENT version of vmalert for configurations with high number of groups with enabled multitenancy.
+## [v1.97.5](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.97.5)
+
+Released at 2024-06-07
+
+**v1.97.x is a line of [LTS releases](https://docs.victoriametrics.com/lts-releases/). It contains important up-to-date bugfixes for [VictoriaMetrics enterprise](https://docs.victoriametrics.com/enterprise.html).
+All these fixes are also included in [the latest community release](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/latest).
+The v1.97.x line will be supported for at least 12 months since [v1.97.0](https://docs.victoriametrics.com/CHANGELOG.html#v1970) release**
+
+* SECURITY: upgrade Go builder from Go1.22.2 to Go1.22.4. See the list of issues addressed in [Go1.22.3](https://github.com/golang/go/issues?q=milestone%3AGo1.22.3+label%3ACherryPickApproved) and [Go1.22.4](https://github.com/golang/go/issues?q=milestone%3AGo1.22.4+label%3ACherryPickApproved).
+* SECURITY: upgrade base docker image (Alpine) from 3.19.1 to 3.20.0. See [alpine 3.20.0 release notes](https://www.alpinelinux.org/posts/Alpine-3.20.0-released.html).
+
+* BUGFIX: [vmui](https://docs.victoriametrics.com/#vmui): fix calendar display when `UTC+00:00` timezone is set. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6239).
+* BUGFIX: [vmui](https://docs.victoriametrics.com/#vmui): remove redundant requests on the `Explore Cardinality` page. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6240).
+* BUGFIX: [vmui](https://docs.victoriametrics.com/#vmui): fix handling of URL params for browser history navigation (back and forward buttons). See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6126) and [this comment](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5516#issuecomment-1867507232).
+* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent/): skip empty data blocks before sending to the remote write destination. Thanks to @viperstars for [the pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/6241).
+* BUGFIX: properly estimate the needed memory for query execution if it has the format [`aggr_func`](https://docs.victoriametrics.com/metricsql/#aggregate-functions)([`rollup_func[d]`](https://docs.victoriametrics.com/metricsql/#rollup-functions) (for example, `sum(rate(request_duration_seconds_bucket[5m]))`). This should allow performing aggregations over bigger number of time series when VictoriaMetrics runs in environments with small amounts of available memory. The issue has been introduced in [this commit](https://github.com/VictoriaMetrics/VictoriaMetrics/commit/5138eaeea0791caa34bcfab410e0ca9cd253cd8f) in [v1.83.0](https://docs.victoriametrics.com/changelog_2022/#v1830).
+* BUGFIX: [Single-node VictoriaMetrics](https://docs.victoriametrics.com/) and `vmstorage` in [VictoriaMetrics cluster](https://docs.victoriametrics.com/cluster-victoriametrics/): correctly apply `-inmemoryDataFlushInterval` when it's set to minimum supported value 1s.
+* BUGFIX: [vmauth](https://docs.victoriametrics.com/vmauth/): properly release memory used for metrics during config reload. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6247).
+* BUGFIX: [Single-node VictoriaMetrics](https://docs.victoriametrics.com/) and `vmselect` in [VictoriaMetrics cluster](https://docs.victoriametrics.com/cluster-victoriametrics/): filter deleted label names and values from [`/api/v1/labels`](https://docs.victoriametrics.com/url-examples/#apiv1labels) and [`/api/v1/label/.../values`](https://docs.victoriametrics.com/url-examples/#apiv1labelvalues) responses when `match[]` filter matches small number of time series. The issue was introduced [v1.81.0](https://docs.victoriametrics.com/changelog_2022/#v1810).
+* BUGFIX: [vmalert](https://docs.victoriametrics.com/vmalert/): fix misleading error logs in vmalert's stdout when unsupported HTTP path is requested.
+* BUGFIX: retry files delete attempts on vXFS file system for `EEXIST` error type. See the [related issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6396). Thanks to @pludov for the [pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/6398).
+
## [v1.97.4](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.97.4)
Released at 2024-04-19
@@ -421,6 +450,23 @@ See changes [here](https://docs.victoriametrics.com/changelog_2023/#v1950)
See changes [here](https://docs.victoriametrics.com/changelog_2023/#v1940)
+## [v1.93.15](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.93.15)
+
+Released at 2024-06-07
+
+**v1.93.x is a line of [LTS releases](https://docs.victoriametrics.com/lts-releases/). It contains important up-to-date bugfixes.
+The v1.93.x line will be supported for at least 12 months since [v1.93.0](https://docs.victoriametrics.com/CHANGELOG.html#v1930) release**
+
+* SECURITY: upgrade Go builder from Go1.22.2 to Go1.22.4. See the list of issues addressed in [Go1.22.3](https://github.com/golang/go/issues?q=milestone%3AGo1.22.3+label%3ACherryPickApproved) and [Go1.22.4](https://github.com/golang/go/issues?q=milestone%3AGo1.22.4+label%3ACherryPickApproved).
+* SECURITY: upgrade base docker image (Alpine) from 3.19.1 to 3.20.0. See [alpine 3.20.0 release notes](https://www.alpinelinux.org/posts/Alpine-3.20.0-released.html).
+
+* BUGFIX: [vmui](https://docs.victoriametrics.com/#vmui): fix calendar display when `UTC+00:00` timezone is set. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6239).
+* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent/): skip empty data blocks before sending to the remote write destination. Thanks to @viperstars for [the pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/6241).
+* BUGFIX: properly estimate the needed memory for query execution if it has the format [`aggr_func`](https://docs.victoriametrics.com/metricsql/#aggregate-functions)([`rollup_func[d]`](https://docs.victoriametrics.com/metricsql/#rollup-functions) (for example, `sum(rate(request_duration_seconds_bucket[5m]))`). This should allow performing aggregations over bigger number of time series when VictoriaMetrics runs in environments with small amounts of available memory. The issue has been introduced in [this commit](https://github.com/VictoriaMetrics/VictoriaMetrics/commit/5138eaeea0791caa34bcfab410e0ca9cd253cd8f) in [v1.83.0](https://docs.victoriametrics.com/changelog_2022/#v1830).
+* BUGFIX: [Single-node VictoriaMetrics](https://docs.victoriametrics.com/) and `vmselect` in [VictoriaMetrics cluster](https://docs.victoriametrics.com/cluster-victoriametrics/): filter deleted label names and values from [`/api/v1/labels`](https://docs.victoriametrics.com/url-examples/#apiv1labels) and [`/api/v1/label/.../values`](https://docs.victoriametrics.com/url-examples/#apiv1labelvalues) responses when `match[]` filter matches small number of time series. The issue was introduced [v1.81.0](https://docs.victoriametrics.com/changelog_2022/#v1810).
+* BUGFIX: [vmalert](https://docs.victoriametrics.com/vmalert/): fix misleading error logs in vmalert's stdout when unsupported HTTP path is requested.
+* BUGFIX: retry files delete attempts on vXFS file system for `EEXIST` error type. See the [related issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6396). Thanks to @pludov for the [pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/6398).
+
## [v1.93.14](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.93.14)
Released at 2024-04-19
diff --git a/docs/LTS-releases.md b/docs/LTS-releases.md
index 178ec66d1..eacc5a5b5 100644
--- a/docs/LTS-releases.md
+++ b/docs/LTS-releases.md
@@ -23,5 +23,5 @@ to [the latest available releases](https://docs.victoriametrics.com/changelog/).
## Currently supported LTS release lines
-- 1.97.x - the latest one is [v1.97.4 LTS release](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.97.4)
-- 1.93.x - the latest one is [v1.93.14 LTS release](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.93.14)
+- 1.97.x - the latest one is [v1.97.5 LTS release](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.97.5)
+- 1.93.x - the latest one is [v1.93.15 LTS release](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.93.15)
diff --git a/docs/README.md b/docs/README.md
index 4e52484ad..74470eb62 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -120,7 +120,7 @@ VictoriaMetrics ecosystem contains the following components additionally to [sin
- [vmalert](https://docs.victoriametrics.com/vmalert/) - a service for processing Prometheus-compatible alerting and recording rules.
- [vmalert-tool](https://docs.victoriametrics.com/vmalert-tool/) - a tool for validating alerting and recording rules.
- [vmauth](https://docs.victoriametrics.com/vmauth/) - authorization proxy and load balancer optimized for VictoriaMetrics products.
-- [vmgateway](https://docs.victoriametrics.com/vmgateway/) - authorization proxy with per-[tenant](https://docs.victoriametrics.com/cluster-victoriametrics/#multitenancy) rate limiting cababilities.
+- [vmgateway](https://docs.victoriametrics.com/vmgateway/) - authorization proxy with per-[tenant](https://docs.victoriametrics.com/cluster-victoriametrics/#multitenancy) rate limiting capabilities.
- [vmctl](https://docs.victoriametrics.com/vmctl/) - a tool for migrating and copying data between different storage systems for metrics.
- [vmbackup](https://docs.victoriametrics.com/vmbackup/), [vmrestore](https://docs.victoriametrics.com/vmrestore/) and [vmbackupmanager](https://docs.victoriametrics.com/vmbackupmanager/) -
tools for creating backups and restoring from backups for VictoriaMetrics data.
diff --git a/docs/Single-server-VictoriaMetrics.md b/docs/Single-server-VictoriaMetrics.md
index 3bc8617a1..c0c3bdec2 100644
--- a/docs/Single-server-VictoriaMetrics.md
+++ b/docs/Single-server-VictoriaMetrics.md
@@ -128,7 +128,7 @@ VictoriaMetrics ecosystem contains the following components additionally to [sin
- [vmalert](https://docs.victoriametrics.com/vmalert/) - a service for processing Prometheus-compatible alerting and recording rules.
- [vmalert-tool](https://docs.victoriametrics.com/vmalert-tool/) - a tool for validating alerting and recording rules.
- [vmauth](https://docs.victoriametrics.com/vmauth/) - authorization proxy and load balancer optimized for VictoriaMetrics products.
-- [vmgateway](https://docs.victoriametrics.com/vmgateway/) - authorization proxy with per-[tenant](https://docs.victoriametrics.com/cluster-victoriametrics/#multitenancy) rate limiting cababilities.
+- [vmgateway](https://docs.victoriametrics.com/vmgateway/) - authorization proxy with per-[tenant](https://docs.victoriametrics.com/cluster-victoriametrics/#multitenancy) rate limiting capabilities.
- [vmctl](https://docs.victoriametrics.com/vmctl/) - a tool for migrating and copying data between different storage systems for metrics.
- [vmbackup](https://docs.victoriametrics.com/vmbackup/), [vmrestore](https://docs.victoriametrics.com/vmrestore/) and [vmbackupmanager](https://docs.victoriametrics.com/vmbackupmanager/) -
tools for creating backups and restoring from backups for VictoriaMetrics data.
diff --git a/go.mod b/go.mod
index 40d4ff04b..3489bd167 100644
--- a/go.mod
+++ b/go.mod
@@ -4,16 +4,16 @@ go 1.22.4
require (
cloud.google.com/go/storage v1.41.0
- github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1
+ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.12.0
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.3.2
github.com/VictoriaMetrics/easyproto v0.1.4
github.com/VictoriaMetrics/fastcache v1.12.2
github.com/VictoriaMetrics/metrics v1.33.1
github.com/VictoriaMetrics/metricsql v0.75.1
- github.com/aws/aws-sdk-go-v2 v1.27.0
- github.com/aws/aws-sdk-go-v2/config v1.27.15
- github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.20
- github.com/aws/aws-sdk-go-v2/service/s3 v1.54.2
+ github.com/aws/aws-sdk-go-v2 v1.27.1
+ github.com/aws/aws-sdk-go-v2/config v1.27.17
+ github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.23
+ github.com/aws/aws-sdk-go-v2/service/s3 v1.55.0
github.com/bmatcuk/doublestar/v4 v4.6.1
github.com/cespare/xxhash/v2 v2.3.0
github.com/cheggaaa/pb/v3 v3.1.5
@@ -22,7 +22,7 @@ require (
github.com/googleapis/gax-go/v2 v2.12.4
github.com/influxdata/influxdb v1.11.5
github.com/klauspost/compress v1.17.8
- github.com/prometheus/prometheus v0.52.0
+ github.com/prometheus/prometheus v0.52.1
github.com/urfave/cli/v2 v2.27.2
github.com/valyala/fastjson v1.6.4
github.com/valyala/fastrand v1.1.0
@@ -30,38 +30,38 @@ require (
github.com/valyala/gozstd v1.21.1
github.com/valyala/histogram v1.2.0
github.com/valyala/quicktemplate v1.7.0
- golang.org/x/oauth2 v0.20.0
- golang.org/x/sys v0.20.0
- google.golang.org/api v0.181.0
+ golang.org/x/oauth2 v0.21.0
+ golang.org/x/sys v0.21.0
+ google.golang.org/api v0.183.0
gopkg.in/yaml.v2 v2.4.0
)
require (
- cloud.google.com/go v0.113.0 // indirect
- cloud.google.com/go/auth v0.4.2 // indirect
+ cloud.google.com/go v0.114.0 // indirect
+ cloud.google.com/go/auth v0.5.1 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect
cloud.google.com/go/compute/metadata v0.3.0 // indirect
cloud.google.com/go/iam v1.1.8 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2 // indirect
- github.com/Azure/azure-sdk-for-go/sdk/internal v1.8.0 // indirect
+ github.com/Azure/azure-sdk-for-go/sdk/internal v1.9.0 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9 // indirect
- github.com/aws/aws-sdk-go v1.53.8 // indirect
+ github.com/aws/aws-sdk-go v1.53.18 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 // indirect
- github.com/aws/aws-sdk-go-v2/credentials v1.17.15 // indirect
- github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.3 // indirect
- github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.7 // indirect
- github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.7 // indirect
+ github.com/aws/aws-sdk-go-v2/credentials v1.17.17 // indirect
+ github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.4 // indirect
+ github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.8 // indirect
+ github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.8 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
- github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.7 // indirect
+ github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.8 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect
- github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.9 // indirect
- github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.9 // indirect
- github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.7 // indirect
- github.com/aws/aws-sdk-go-v2/service/sso v1.20.8 // indirect
- github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.2 // indirect
- github.com/aws/aws-sdk-go-v2/service/sts v1.28.9 // indirect
+ github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.10 // indirect
+ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.10 // indirect
+ github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.8 // indirect
+ github.com/aws/aws-sdk-go-v2/service/sso v1.20.10 // indirect
+ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.4 // indirect
+ github.com/aws/aws-sdk-go-v2/service/sts v1.28.11 // indirect
github.com/aws/smithy-go v1.20.2 // indirect
github.com/bboreham/go-loser v0.0.0-20230920113527-fcc2c21820a3 // indirect
github.com/beorn7/perks v1.0.1 // indirect
@@ -82,7 +82,7 @@ require (
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc // indirect
- github.com/hashicorp/go-version v1.6.0 // indirect
+ github.com/hashicorp/go-version v1.7.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
@@ -98,18 +98,18 @@ require (
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.19.1 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
- github.com/prometheus/common v0.53.0 // indirect
+ github.com/prometheus/common v0.54.0 // indirect
github.com/prometheus/common/sigv4 v0.1.0 // indirect
- github.com/prometheus/procfs v0.15.0 // indirect
+ github.com/prometheus/procfs v0.15.1 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/stretchr/testify v1.9.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
go.opencensus.io v0.24.0 // indirect
- go.opentelemetry.io/collector/featuregate v1.8.0 // indirect
- go.opentelemetry.io/collector/pdata v1.8.0 // indirect
- go.opentelemetry.io/collector/semconv v0.101.0 // indirect
+ go.opentelemetry.io/collector/featuregate v1.9.0 // indirect
+ go.opentelemetry.io/collector/pdata v1.9.0 // indirect
+ go.opentelemetry.io/collector/semconv v0.102.1 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 // indirect
go.opentelemetry.io/otel v1.27.0 // indirect
@@ -118,15 +118,15 @@ require (
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/goleak v1.3.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
- golang.org/x/crypto v0.23.0 // indirect
- golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
- golang.org/x/net v0.25.0 // indirect
+ golang.org/x/crypto v0.24.0 // indirect
+ golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8 // indirect
+ golang.org/x/net v0.26.0 // indirect
golang.org/x/sync v0.7.0 // indirect
- golang.org/x/text v0.15.0 // indirect
+ golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.5.0 // indirect
- google.golang.org/genproto v0.0.0-20240521202816-d264139d666e // indirect
- google.golang.org/genproto/googleapis/api v0.0.0-20240521202816-d264139d666e // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e // indirect
+ google.golang.org/genproto v0.0.0-20240604185151-ef581f913117 // indirect
+ google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect
google.golang.org/grpc v1.64.0 // indirect
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
diff --git a/go.sum b/go.sum
index a1d1b074b..b6bd9d8bf 100644
--- a/go.sum
+++ b/go.sum
@@ -13,10 +13,10 @@ cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKV
cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
-cloud.google.com/go v0.113.0 h1:g3C70mn3lWfckKBiCVsAshabrDg01pQ0pnX1MNtnMkA=
-cloud.google.com/go v0.113.0/go.mod h1:glEqlogERKYeePz6ZdkcLJ28Q2I6aERgDDErBg9GzO8=
-cloud.google.com/go/auth v0.4.2 h1:sb0eyLkhRtpq5jA+a8KWw0W70YcdVca7KJ8TM0AFYDg=
-cloud.google.com/go/auth v0.4.2/go.mod h1:Kqvlz1cf1sNA0D+sYJnkPQOP+JMHkuHeIgVmCRtZOLc=
+cloud.google.com/go v0.114.0 h1:OIPFAdfrFDFO2ve2U7r/H5SwSbBzEdrBdE7xkgwc+kY=
+cloud.google.com/go v0.114.0/go.mod h1:ZV9La5YYxctro1HTPug5lXH/GefROyW8PPD4T8n9J8E=
+cloud.google.com/go/auth v0.5.1 h1:0QNO7VThG54LUzKiQxv8C6x1YX7lUrzlAa1nVLF8CIw=
+cloud.google.com/go/auth v0.5.1/go.mod h1:vbZT8GjzDf3AVqCcQmqeeM32U9HBFc32vVVAbwDsa6s=
cloud.google.com/go/auth/oauth2adapt v0.2.2 h1:+TTV8aXpjeChS9M+aTtN/TjdQnzJvmzKFt//oWu7HX4=
cloud.google.com/go/auth/oauth2adapt v0.2.2/go.mod h1:wcYjgpZI9+Yu7LyYBg4pqSiaRkfEK3GQcpb7C/uyF1Q=
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
@@ -43,12 +43,12 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
cloud.google.com/go/storage v1.41.0 h1:RusiwatSu6lHeEXe3kglxakAmAbfV+rhtPqA6i8RBx0=
cloud.google.com/go/storage v1.41.0/go.mod h1:J1WCa/Z2FcgdEDuPUY8DxT5I+d9mFKsCepp5vR6Sq80=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
-github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 h1:E+OJmp2tPvt1W+amx48v1eqbjDYsgN+RzP4q16yV5eM=
-github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1/go.mod h1:a6xsAQUZg+VsS3TJ05SRp524Hs4pZ/AeFSr5ENf0Yjo=
+github.com/Azure/azure-sdk-for-go/sdk/azcore v1.12.0 h1:1nGuui+4POelzDwI7RG56yfQJHCnKvwfMoU7VsEp+Zg=
+github.com/Azure/azure-sdk-for-go/sdk/azcore v1.12.0/go.mod h1:99EvauvlcJ1U06amZiksfYz/3aFGyIhWGHVyiZXtBAI=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2 h1:FDif4R1+UUR+00q6wquyX90K7A8dN+R5E8GEadoP7sU=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2/go.mod h1:aiYBYui4BJ/BJCAIKs92XiPyQfTaBWqvHujDwKb6CBU=
-github.com/Azure/azure-sdk-for-go/sdk/internal v1.8.0 h1:jBQA3cKT4L2rWMpgE7Yt3Hwh2aUj8KXjIGLxjHeYNNo=
-github.com/Azure/azure-sdk-for-go/sdk/internal v1.8.0/go.mod h1:4OG6tQ9EOP/MT0NMjDlRzWoVFxfu9rN9B2X+tlSVktg=
+github.com/Azure/azure-sdk-for-go/sdk/internal v1.9.0 h1:H+U3Gk9zY56G3u872L82bk4thcsy2Gghb9ExT4Zvm1o=
+github.com/Azure/azure-sdk-for-go/sdk/internal v1.9.0/go.mod h1:mgrmMSgaLp9hmax62XQTd0N4aAqSE5E0DulSpVYK7vc=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.6.0 h1:ui3YNbxfW7J3tTFIZMH6LIGRjCngp+J+nIFlnizfNTE=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.6.0/go.mod h1:gZmgV+qBqygoznvqo2J9oKZAFziqhLZ2xE/WVUmzkHA=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4 v4.3.0 h1:bXwSugBiSbgtz7rOtbfGf+woewp4f06orW9OP5BjHLA=
@@ -89,44 +89,44 @@ github.com/andybalholm/brotli v1.0.3/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHG
github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA=
github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4=
github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
-github.com/aws/aws-sdk-go v1.53.8 h1:eoqGb1WOHIrCFKo1d51cMcnt1ralfLFaEqRkC5Zzv8k=
-github.com/aws/aws-sdk-go v1.53.8/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
-github.com/aws/aws-sdk-go-v2 v1.27.0 h1:7bZWKoXhzI+mMR/HjdMx8ZCC5+6fY0lS5tr0bbgiLlo=
-github.com/aws/aws-sdk-go-v2 v1.27.0/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM=
+github.com/aws/aws-sdk-go v1.53.18 h1:BeMeCK5e3bDGJj675FhnO94zRci8O35ombWXRvYomJs=
+github.com/aws/aws-sdk-go v1.53.18/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
+github.com/aws/aws-sdk-go-v2 v1.27.1 h1:xypCL2owhog46iFxBKKpBcw+bPTX/RJzwNj8uSilENw=
+github.com/aws/aws-sdk-go-v2 v1.27.1/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 h1:x6xsQXGSmW6frevwDA+vi/wqhp1ct18mVXYN08/93to=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2/go.mod h1:lPprDr1e6cJdyYeGXnRaJoP4Md+cDBvi2eOj00BlGmg=
-github.com/aws/aws-sdk-go-v2/config v1.27.15 h1:uNnGLZ+DutuNEkuPh6fwqK7LpEiPmzb7MIMA1mNWEUc=
-github.com/aws/aws-sdk-go-v2/config v1.27.15/go.mod h1:7j7Kxx9/7kTmL7z4LlhwQe63MYEE5vkVV6nWg4ZAI8M=
-github.com/aws/aws-sdk-go-v2/credentials v1.17.15 h1:YDexlvDRCA8ems2T5IP1xkMtOZ1uLJOCJdTr0igs5zo=
-github.com/aws/aws-sdk-go-v2/credentials v1.17.15/go.mod h1:vxHggqW6hFNaeNC0WyXS3VdyjcV0a4KMUY4dKJ96buU=
-github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.3 h1:dQLK4TjtnlRGb0czOht2CevZ5l6RSyRWAnKeGd7VAFE=
-github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.3/go.mod h1:TL79f2P6+8Q7dTsILpiVST+AL9lkF6PPGI167Ny0Cjw=
-github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.20 h1:NCM9wYaJCmlIWZSO/JwUEveKf0NCvsSgo9V9BwOAolo=
-github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.20/go.mod h1:dmxIx3qriuepxqZgFeFMitFuftWPB94+MZv/6Btpth4=
-github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.7 h1:lf/8VTF2cM+N4SLzaYJERKEWAXq8MOMpZfU6wEPWsPk=
-github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.7/go.mod h1:4SjkU7QiqK2M9oozyMzfZ/23LmUY+h3oFqhdeP5OMiI=
-github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.7 h1:4OYVp0705xu8yjdyoWix0r9wPIRXnIzzOoUpQVHIJ/g=
-github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.7/go.mod h1:vd7ESTEvI76T2Na050gODNmNU7+OyKrIKroYTu4ABiI=
+github.com/aws/aws-sdk-go-v2/config v1.27.17 h1:L0JZN7Gh7pT6u5CJReKsLhGKparqNKui+mcpxMXjDZc=
+github.com/aws/aws-sdk-go-v2/config v1.27.17/go.mod h1:MzM3balLZeaafYcPz8IihAmam/aCz6niPQI0FdprxW0=
+github.com/aws/aws-sdk-go-v2/credentials v1.17.17 h1:b3Dk9uxQByS9sc6r0sc2jmxsJKO75eOcb9nNEiaUBLM=
+github.com/aws/aws-sdk-go-v2/credentials v1.17.17/go.mod h1:e4khg9iY08LnFK/HXQDWMf9GDaiMari7jWPnXvKAuBU=
+github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.4 h1:0cSfTYYL9qiRcdi4Dvz+8s3JUgNR2qvbgZkXcwPEEEk=
+github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.4/go.mod h1:Wjn5O9eS7uSi7vlPKt/v0MLTncANn9EMmoDvnzJli6o=
+github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.23 h1:g6IHovcexw51hcP0hxsT7Mr3/PG76hZvoodm9tuKuUc=
+github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.23/go.mod h1:8KSZ0CibxgOaPk28CFL4DGBdGrscHJr8FuxB+jnJBaM=
+github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.8 h1:RnLB7p6aaFMRfyQkD6ckxR7myCC9SABIqSz4czYUUbU=
+github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.8/go.mod h1:XH7dQJd+56wEbP1I4e4Duo+QhSMxNArE8VP7NuUOTeM=
+github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.8 h1:jzApk2f58L9yW9q1GEab3BMMFWUkkiZhyrRUtbwUbKU=
+github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.8/go.mod h1:WqO+FftfO3tGePUtQxPXM6iODVfqMwsVMgTbG/ZXIdQ=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY=
-github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.7 h1:/FUtT3xsoHO3cfh+I/kCbcMCN98QZRsiFet/V8QkWSs=
-github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.7/go.mod h1:MaCAgWpGooQoCWZnMur97rGn5dp350w2+CeiV5406wE=
+github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.8 h1:jH33S0y5Bo5ZVML62JgZhjd/LrtU+vbR8W7XnIE3Srk=
+github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.8/go.mod h1:hD5YwHLOy6k7d6kqcn3me1bFWHOtzhaXstMd6BpdB68=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 h1:Ji0DY1xUsUr3I8cHps0G+XM3WWU16lP6yG8qu1GAZAs=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2/go.mod h1:5CsjAbs3NlGQyZNFACh+zztPDI7fU6eW9QsxjfnuBKg=
-github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.9 h1:UXqEWQI0n+q0QixzU0yUUQBZXRd5037qdInTIHFTl98=
-github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.9/go.mod h1:xP6Gq6fzGZT8w/ZN+XvGMZ2RU1LeEs7b2yUP5DN8NY4=
-github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.9 h1:Wx0rlZoEJR7JwlSZcHnEa7CNjrSIyVxMFWGAaXy4fJY=
-github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.9/go.mod h1:aVMHdE0aHO3v+f/iw01fmXV/5DbfQ3Bi9nN7nd9bE9Y=
-github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.7 h1:uO5XR6QGBcmPyo2gxofYJLFkcVQ4izOoGDNenlZhTEk=
-github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.7/go.mod h1:feeeAYfAcwTReM6vbwjEyDmiGho+YgBhaFULuXDW8kc=
-github.com/aws/aws-sdk-go-v2/service/s3 v1.54.2 h1:gYSJhNiOF6J9xaYxu2NFNstoiNELwt0T9w29FxSfN+Y=
-github.com/aws/aws-sdk-go-v2/service/s3 v1.54.2/go.mod h1:739CllldowZiPPsDFcJHNF4FXrVxaSGVnZ9Ez9Iz9hc=
-github.com/aws/aws-sdk-go-v2/service/sso v1.20.8 h1:Kv1hwNG6jHC/sxMTe5saMjH6t6ZLkgfvVxyEjfWL1ks=
-github.com/aws/aws-sdk-go-v2/service/sso v1.20.8/go.mod h1:c1qtZUWtygI6ZdvKppzCSXsDOq5I4luJPZ0Ud3juFCA=
-github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.2 h1:nWBZ1xHCF+A7vv9sDzJOq4NWIdzFYm0kH7Pr4OjHYsQ=
-github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.2/go.mod h1:9lmoVDVLz/yUZwLaQ676TK02fhCu4+PgRSmMaKR1ozk=
-github.com/aws/aws-sdk-go-v2/service/sts v1.28.9 h1:Qp6Boy0cGDloOE3zI6XhNLNZgjNS8YmiFQFHe71SaW0=
-github.com/aws/aws-sdk-go-v2/service/sts v1.28.9/go.mod h1:0Aqn1MnEuitqfsCNyKsdKLhDUOr4txD/g19EfiUqgws=
+github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.10 h1:pkYC5zTOSPXEYJj56b2SOik9AL432i5MT1YVTQbKOK0=
+github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.10/go.mod h1:/WNsBOlKWZCG3PMh2aSp8vkyyT/clpMZqOtrnIKqGfk=
+github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.10 h1:7kZqP7akv0enu6ykJhb9OYlw16oOrSy+Epus8o/VqMY=
+github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.10/go.mod h1:gYVF3nM1ApfTRDj9pvdhootBb8WbiIejuqn4w8ruMes=
+github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.8 h1:iQNXVs1vtaq+y9M90M4ZIVNORje0qXTscqHLqoOnFS0=
+github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.8/go.mod h1:yUQPRlWqGG0lfNsmjbRWKVwgilfBtZTOFSLEYALlAig=
+github.com/aws/aws-sdk-go-v2/service/s3 v1.55.0 h1:6kq0Xql9qiwNGL/Go87ZqR4otg9jnKs71OfWCVbPxLM=
+github.com/aws/aws-sdk-go-v2/service/s3 v1.55.0/go.mod h1:oSkRFuHVWmUY4Ssk16ErGzBqvYEbvORJFzFXzWhTB2s=
+github.com/aws/aws-sdk-go-v2/service/sso v1.20.10 h1:ItKVmFwbyb/ZnCWf+nu3XBVmUirpO9eGEQd7urnBA0s=
+github.com/aws/aws-sdk-go-v2/service/sso v1.20.10/go.mod h1:5XKooCTi9VB/xZmJDvh7uZ+v3uQ7QdX6diOyhvPA+/w=
+github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.4 h1:QMSCYDg3Iyls0KZc/dk3JtS2c1lFfqbmYO10qBPPkJk=
+github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.4/go.mod h1:MZ/PVYU/mRbmSF6WK3ybCYHjA2mig8utVokDEVLDgE0=
+github.com/aws/aws-sdk-go-v2/service/sts v1.28.11 h1:HYS0csS7UJxdYRoG+bGgUYrSwVnV3/ece/wHm90TApM=
+github.com/aws/aws-sdk-go-v2/service/sts v1.28.11/go.mod h1:QXnthRM35zI92048MMwfFChjFmoufTdhtHmouwNfhhU=
github.com/aws/smithy-go v1.20.2 h1:tbp628ireGtzcHDDmLT/6ADHidqnwgF57XOXZe6tp4Q=
github.com/aws/smithy-go v1.20.2/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E=
github.com/bboreham/go-loser v0.0.0-20230920113527-fcc2c21820a3 h1:6df1vn4bBlDDo4tARvBm7l6KA9iVMnE3NWizDeWSrps=
@@ -324,8 +324,8 @@ github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZn
github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8=
github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc=
github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=
-github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
-github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
+github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY=
+github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.6.0 h1:uL2shRDx7RTrOrTCUZEGP/wJUFiUI8QT6E7z5o8jga4=
@@ -375,8 +375,9 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
-github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
+github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/linode/linodego v1.32.0 h1:OmZzB3iON6uu84VtLFf64uKmAQqJJarvmsVguroioPI=
@@ -444,18 +445,18 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
-github.com/prometheus/common v0.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+aLCE=
-github.com/prometheus/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U=
+github.com/prometheus/common v0.54.0 h1:ZlZy0BgJhTwVZUn7dLOkwCZHUkrAqd3WYtcFCWnM1D8=
+github.com/prometheus/common v0.54.0/go.mod h1:/TQgMJP5CuVYveyT7n/0Ix8yLNNXy9yRSkhnLTHPDIQ=
github.com/prometheus/common/sigv4 v0.1.0 h1:qoVebwtwwEhS85Czm2dSROY5fTo2PAPEVdDeppTwGX4=
github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57JrvHu9k5YwTjsNtI=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
-github.com/prometheus/procfs v0.15.0 h1:A82kmvXJq2jTu5YUhSGNlYoxh85zLnKgPz4bMZgI5Ek=
-github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4VQSw2sQJLHk=
-github.com/prometheus/prometheus v0.52.0 h1:f7kHJgr7+zShpWdTCeKqbCWR7nKTScgLYQwRux9h1V0=
-github.com/prometheus/prometheus v0.52.0/go.mod h1:3z74cVsmVH0iXOR5QBjB7Pa6A0KJeEAK5A6UsmAFb1g=
+github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
+github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
+github.com/prometheus/prometheus v0.52.1 h1:BrQ29YG+mzdGh8DgHPirHbeMGNqtL+INe0rqg7ttBJ4=
+github.com/prometheus/prometheus v0.52.1/go.mod h1:3z74cVsmVH0iXOR5QBjB7Pa6A0KJeEAK5A6UsmAFb1g=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
@@ -519,12 +520,12 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
-go.opentelemetry.io/collector/featuregate v1.8.0 h1:p/bAuk5LiSfdYS88yFl/Jzao9bHEYqCh7YvZJ+L+IZg=
-go.opentelemetry.io/collector/featuregate v1.8.0/go.mod h1:w7nUODKxEi3FLf1HslCiE6YWtMtOOrMnSwsDam8Mg9w=
-go.opentelemetry.io/collector/pdata v1.8.0 h1:d/QQgZxB4Y+d3mqLVh2ozvzujUhloD3P/fk7X+In764=
-go.opentelemetry.io/collector/pdata v1.8.0/go.mod h1:/W7clu0wFC4WSRp94Ucn6Vm36Wkrt+tmtlDb1aiNZCY=
-go.opentelemetry.io/collector/semconv v0.101.0 h1:tOe9iTe9dDCnvz/bqgfNRr4w80kXG8505tQJ5h5v08Q=
-go.opentelemetry.io/collector/semconv v0.101.0/go.mod h1:8ElcRZ8Cdw5JnvhTOQOdYizkJaQ10Z2fS+R6djOnj6A=
+go.opentelemetry.io/collector/featuregate v1.9.0 h1:mC4/HnR5cx/kkG1RKOQAvHxxg5Ktmd9gpFdttPEXQtA=
+go.opentelemetry.io/collector/featuregate v1.9.0/go.mod h1:PsOINaGgTiFc+Tzu2K/X2jP+Ngmlp7YKGV1XrnBkH7U=
+go.opentelemetry.io/collector/pdata v1.9.0 h1:qyXe3HEVYYxerIYu0rzgo1Tx2d1Zs6iF+TCckbHLFOw=
+go.opentelemetry.io/collector/pdata v1.9.0/go.mod h1:vk7LrfpyVpGZrRWcpjyy0DDZzL3SZiYMQxfap25551w=
+go.opentelemetry.io/collector/semconv v0.102.1 h1:zLhz2Gu//j7HHESFTGTrfKIaoS4r+lZFQDnGCOThggo=
+go.opentelemetry.io/collector/semconv v0.102.1/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 h1:vS1Ao/R55RNV4O7TA2Qopok8yN+X0LIP6RVWLFkprck=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0/go.mod h1:BMsdeOxN04K0L5FNUBfjFdvwWGNe/rkmSwH4Aelu/X0=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 h1:9l89oX4ba9kHbBol3Xin3leYJ+252h0zszDtBwyKe2A=
@@ -550,8 +551,8 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
-golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
-golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
+golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI=
+golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -562,8 +563,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
-golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM=
-golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc=
+golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8 h1:LoYXNGAShUG3m/ehNk4iFctuhGX/+R1ZpfJ4/ia80JM=
+golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
@@ -584,8 +585,8 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
-golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
-golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
+golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0=
+golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -619,16 +620,16 @@ golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwY
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
-golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
+golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ=
+golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo=
-golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
+golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs=
+golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -684,19 +685,19 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
-golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
+golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
-golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw=
-golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
+golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA=
+golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
-golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
+golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -744,8 +745,8 @@ golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw=
-golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
+golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA=
+golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -768,8 +769,8 @@ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M
google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
-google.golang.org/api v0.181.0 h1:rPdjwnWgiPPOJx3IcSAQ2III5aX5tCer6wMpa/xmZi4=
-google.golang.org/api v0.181.0/go.mod h1:MnQ+M0CFsfUwA5beZ+g/vCBCPXvtmZwRz2qzZk8ih1k=
+google.golang.org/api v0.183.0 h1:PNMeRDwo1pJdgNcFQ9GstuLe/noWKIc89pRWRLMvLwE=
+google.golang.org/api v0.183.0/go.mod h1:q43adC5/pHoSZTx5h2mSmdF7NcyfW9JuDyIOJAgS9ZQ=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
@@ -805,12 +806,12 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20240521202816-d264139d666e h1:axIBUGXSVho2zB+3tJj8l9Qvm/El5vVYPYqhGA5PmJM=
-google.golang.org/genproto v0.0.0-20240521202816-d264139d666e/go.mod h1:gOvX/2dWTqh+u3+IHjFeCxinlz5AZ5qhOufbQPub/dE=
-google.golang.org/genproto/googleapis/api v0.0.0-20240521202816-d264139d666e h1:SkdGTrROJl2jRGT/Fxv5QUf9jtdKCQh4KQJXbXVLAi0=
-google.golang.org/genproto/googleapis/api v0.0.0-20240521202816-d264139d666e/go.mod h1:LweJcLbyVij6rCex8YunD8DYR5VDonap/jYl3ZRxcIU=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e h1:Elxv5MwEkCI9f5SkoL6afed6NTdxaGoAo39eANBwHL8=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0=
+google.golang.org/genproto v0.0.0-20240604185151-ef581f913117 h1:HCZ6DlkKtCDAtD8ForECsY3tKuaR+p4R3grlK80uCCc=
+google.golang.org/genproto v0.0.0-20240604185151-ef581f913117/go.mod h1:lesfX/+9iA+3OdqeCpoDddJaNxVB1AB6tD7EfqMmprc=
+google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 h1:+rdxYoE3E5htTEWIe15GlN6IfvbURM//Jt0mmkmm6ZU=
+google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117/go.mod h1:OimBR/bc1wPO9iV4NC2bpyjy3VnAwZh5EBPQdtaE5oo=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
diff --git a/lib/promrelabel/if_expression.go b/lib/promrelabel/if_expression.go
index 1f3506dfb..7d102a1f6 100644
--- a/lib/promrelabel/if_expression.go
+++ b/lib/promrelabel/if_expression.go
@@ -287,10 +287,22 @@ func (lf *labelFilter) match(labels []prompbmarshal.Label) bool {
return false
}
+func (lf *labelFilter) equalNameValue(labels []prompbmarshal.Label) bool {
+ for _, label := range labels {
+ if label.Name == "__name__" {
+ return label.Value == lf.value
+ }
+ }
+ return false
+}
+
func (lf *labelFilter) equalValue(labels []prompbmarshal.Label) bool {
+ if lf.label == "" {
+ return lf.equalNameValue(labels)
+ }
labelNameMatches := 0
for _, label := range labels {
- if toCanonicalLabelName(label.Name) != lf.label {
+ if label.Name != lf.label {
continue
}
labelNameMatches++
diff --git a/lib/promrelabel/if_expression_timing_test.go b/lib/promrelabel/if_expression_timing_test.go
new file mode 100644
index 000000000..a407d8e86
--- /dev/null
+++ b/lib/promrelabel/if_expression_timing_test.go
@@ -0,0 +1,78 @@
+package promrelabel
+
+import (
+ "fmt"
+ "gopkg.in/yaml.v2"
+ "testing"
+
+ "github.com/VictoriaMetrics/VictoriaMetrics/lib/prompbmarshal"
+)
+
+func BenchmarkIfExpression(b *testing.B) {
+ const maxLabels = 100
+ labels := make([]prompbmarshal.Label, maxLabels)
+ for i := 0; i < maxLabels; i++ {
+ label := prompbmarshal.Label{
+ Name: fmt.Sprintf("foo%d", i),
+ Value: fmt.Sprintf("bar%d", i),
+ }
+ labels[i] = label
+ }
+
+ b.Run("equal label: last", func(b *testing.B) {
+ n := maxLabels - 1
+ ifExpr := fmt.Sprintf(`'{foo%d="bar%d"}'`, n, n)
+ benchIfExpr(b, ifExpr, labels)
+ })
+ b.Run("equal label: middle", func(b *testing.B) {
+ n := maxLabels / 2
+ ifExpr := fmt.Sprintf(`'{foo%d="bar%d"}'`, n, n)
+ benchIfExpr(b, ifExpr, labels)
+ })
+ b.Run("equal label: first", func(b *testing.B) {
+ ifExpr := fmt.Sprintf(`'{foo%d="bar%d"}'`, 0, 0)
+ benchIfExpr(b, ifExpr, labels)
+ })
+
+ labels[maxLabels-1] = prompbmarshal.Label{
+ Name: "__name__",
+ Value: "foo",
+ }
+ b.Run("equal __name__: last", func(b *testing.B) {
+ ifExpr := `foo`
+ benchIfExpr(b, ifExpr, labels)
+ })
+
+ labels[maxLabels/2] = prompbmarshal.Label{
+ Name: "__name__",
+ Value: "foo",
+ }
+ b.Run("equal __name__: middle", func(b *testing.B) {
+ ifExpr := `foo`
+ benchIfExpr(b, ifExpr, labels)
+ })
+
+ labels[0] = prompbmarshal.Label{
+ Name: "__name__",
+ Value: "foo",
+ }
+ b.Run("equal __name__: first", func(b *testing.B) {
+ ifExpr := `foo`
+ benchIfExpr(b, ifExpr, labels)
+ })
+}
+
+func benchIfExpr(b *testing.B, expr string, labels []prompbmarshal.Label) {
+ b.Helper()
+ var ie IfExpression
+ if err := yaml.UnmarshalStrict([]byte(expr), &ie); err != nil {
+ b.Fatalf("unexpected error during unmarshal: %s", err)
+ }
+ b.RunParallel(func(pb *testing.PB) {
+ for pb.Next() {
+ if !ie.Match(labels) {
+ panic(fmt.Sprintf("expected to have a match for %q", expr))
+ }
+ }
+ })
+}
diff --git a/lib/streamaggr/avg.go b/lib/streamaggr/avg.go
index 131c9a8a0..2d0546058 100644
--- a/lib/streamaggr/avg.go
+++ b/lib/streamaggr/avg.go
@@ -3,6 +3,7 @@ package streamaggr
import (
"sync"
+ "github.com/VictoriaMetrics/VictoriaMetrics/lib/bytesutil"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/fasttime"
)
@@ -35,6 +36,7 @@ func (as *avgAggrState) pushSamples(samples []pushSample) {
sum: s.value,
count: 1,
}
+ outputKey = bytesutil.InternString(outputKey)
vNew, loaded := as.m.LoadOrStore(outputKey, v)
if !loaded {
// The entry has been successfully stored
diff --git a/lib/streamaggr/count_samples.go b/lib/streamaggr/count_samples.go
index 30099d4bd..f48ae44dd 100644
--- a/lib/streamaggr/count_samples.go
+++ b/lib/streamaggr/count_samples.go
@@ -3,6 +3,7 @@ package streamaggr
import (
"sync"
+ "github.com/VictoriaMetrics/VictoriaMetrics/lib/bytesutil"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/fasttime"
)
@@ -33,6 +34,7 @@ func (as *countSamplesAggrState) pushSamples(samples []pushSample) {
v = &countSamplesStateValue{
n: 1,
}
+ outputKey = bytesutil.InternString(outputKey)
vNew, loaded := as.m.LoadOrStore(outputKey, v)
if !loaded {
// The new entry has been successfully created.
diff --git a/lib/streamaggr/count_series.go b/lib/streamaggr/count_series.go
index a80c69dbb..edf4a95a4 100644
--- a/lib/streamaggr/count_series.go
+++ b/lib/streamaggr/count_series.go
@@ -41,6 +41,7 @@ func (as *countSeriesAggrState) pushSamples(samples []pushSample) {
h: {},
},
}
+ outputKey = bytesutil.InternString(outputKey)
vNew, loaded := as.m.LoadOrStore(outputKey, v)
if !loaded {
// The entry has been added to the map.
diff --git a/lib/streamaggr/dedup.go b/lib/streamaggr/dedup.go
index c9ac3dc67..399e9a3dc 100644
--- a/lib/streamaggr/dedup.go
+++ b/lib/streamaggr/dedup.go
@@ -175,7 +175,8 @@ func (das *dedupAggrShard) pushSamples(samples []pushSample) {
for _, sample := range samples {
s, ok := m[sample.key]
if !ok {
- m[sample.key] = dedupAggrSample{
+ key := bytesutil.InternString(sample.key)
+ m[key] = dedupAggrSample{
value: sample.value,
timestamp: sample.timestamp,
}
@@ -183,7 +184,8 @@ func (das *dedupAggrShard) pushSamples(samples []pushSample) {
}
// Update the existing value according to logic described at https://docs.victoriametrics.com/#deduplication
if sample.timestamp > s.timestamp || (sample.timestamp == s.timestamp && sample.value > s.value) {
- m[sample.key] = dedupAggrSample{
+ key := bytesutil.InternString(sample.key)
+ m[key] = dedupAggrSample{
value: sample.value,
timestamp: sample.timestamp,
}
diff --git a/lib/streamaggr/deduplicator.go b/lib/streamaggr/deduplicator.go
index a96d765c2..3ec25f5fa 100644
--- a/lib/streamaggr/deduplicator.go
+++ b/lib/streamaggr/deduplicator.go
@@ -94,8 +94,9 @@ func (d *Deduplicator) Push(tss []prompbmarshal.TimeSeries) {
}
labels.Sort()
- buf = lc.Compress(buf[:0], labels.Labels)
- key := bytesutil.InternBytes(buf)
+ bufLen := len(buf)
+ buf = lc.Compress(buf, labels.Labels)
+ key := bytesutil.ToUnsafeString(buf[bufLen:])
for _, s := range ts.Samples {
pss = append(pss, pushSample{
key: key,
diff --git a/lib/streamaggr/histogram_bucket.go b/lib/streamaggr/histogram_bucket.go
index aba933ae4..4cce32c2d 100644
--- a/lib/streamaggr/histogram_bucket.go
+++ b/lib/streamaggr/histogram_bucket.go
@@ -5,6 +5,7 @@ import (
"sync"
"time"
+ "github.com/VictoriaMetrics/VictoriaMetrics/lib/bytesutil"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/fasttime"
"github.com/VictoriaMetrics/metrics"
)
@@ -42,6 +43,7 @@ func (as *histogramBucketAggrState) pushSamples(samples []pushSample) {
if !ok {
// The entry is missing in the map. Try creating it.
v = &histogramBucketStateValue{}
+ outputKey = bytesutil.InternString(outputKey)
vNew, loaded := as.m.LoadOrStore(outputKey, v)
if loaded {
// Use the entry created by a concurrent goroutine.
diff --git a/lib/streamaggr/last.go b/lib/streamaggr/last.go
index c8c7881ed..9bf4e08e0 100644
--- a/lib/streamaggr/last.go
+++ b/lib/streamaggr/last.go
@@ -3,6 +3,7 @@ package streamaggr
import (
"sync"
+ "github.com/VictoriaMetrics/VictoriaMetrics/lib/bytesutil"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/fasttime"
)
@@ -35,6 +36,7 @@ func (as *lastAggrState) pushSamples(samples []pushSample) {
last: s.value,
timestamp: s.timestamp,
}
+ outputKey = bytesutil.InternString(outputKey)
vNew, loaded := as.m.LoadOrStore(outputKey, v)
if !loaded {
// The new entry has been successfully created.
diff --git a/lib/streamaggr/max.go b/lib/streamaggr/max.go
index f92036c66..a106d3300 100644
--- a/lib/streamaggr/max.go
+++ b/lib/streamaggr/max.go
@@ -3,6 +3,7 @@ package streamaggr
import (
"sync"
+ "github.com/VictoriaMetrics/VictoriaMetrics/lib/bytesutil"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/fasttime"
)
@@ -33,6 +34,7 @@ func (as *maxAggrState) pushSamples(samples []pushSample) {
v = &maxStateValue{
max: s.value,
}
+ outputKey = bytesutil.InternString(outputKey)
vNew, loaded := as.m.LoadOrStore(outputKey, v)
if !loaded {
// The new entry has been successfully created.
diff --git a/lib/streamaggr/min.go b/lib/streamaggr/min.go
index 17137e6cd..b03105c92 100644
--- a/lib/streamaggr/min.go
+++ b/lib/streamaggr/min.go
@@ -3,6 +3,7 @@ package streamaggr
import (
"sync"
+ "github.com/VictoriaMetrics/VictoriaMetrics/lib/bytesutil"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/fasttime"
)
@@ -33,6 +34,7 @@ func (as *minAggrState) pushSamples(samples []pushSample) {
v = &minStateValue{
min: s.value,
}
+ outputKey = bytesutil.InternString(outputKey)
vNew, loaded := as.m.LoadOrStore(outputKey, v)
if !loaded {
// The new entry has been successfully created.
diff --git a/lib/streamaggr/quantiles.go b/lib/streamaggr/quantiles.go
index b97697ebb..edaa128f5 100644
--- a/lib/streamaggr/quantiles.go
+++ b/lib/streamaggr/quantiles.go
@@ -41,6 +41,7 @@ func (as *quantilesAggrState) pushSamples(samples []pushSample) {
v = &quantilesStateValue{
h: h,
}
+ outputKey = bytesutil.InternString(outputKey)
vNew, loaded := as.m.LoadOrStore(outputKey, v)
if loaded {
// Use the entry created by a concurrent goroutine.
diff --git a/lib/streamaggr/rate.go b/lib/streamaggr/rate.go
index 1eedf1f1d..44e6bcea4 100644
--- a/lib/streamaggr/rate.go
+++ b/lib/streamaggr/rate.go
@@ -4,6 +4,7 @@ import (
"sync"
"time"
+ "github.com/VictoriaMetrics/VictoriaMetrics/lib/bytesutil"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/fasttime"
)
@@ -59,6 +60,7 @@ func (as *rateAggrState) pushSamples(samples []pushSample) {
v = &rateStateValue{
lastValues: make(map[string]rateLastValueState),
}
+ outputKey = bytesutil.InternString(outputKey)
vNew, loaded := as.m.LoadOrStore(outputKey, v)
if loaded {
// Use the entry created by a concurrent goroutine.
@@ -89,6 +91,8 @@ func (as *rateAggrState) pushSamples(samples []pushSample) {
lv.value = s.value
lv.timestamp = s.timestamp
lv.deleteDeadline = deleteDeadline
+
+ inputKey = bytesutil.InternString(inputKey)
sv.lastValues[inputKey] = lv
sv.deleteDeadline = deleteDeadline
}
diff --git a/lib/streamaggr/stddev.go b/lib/streamaggr/stddev.go
index 0eb6df6fe..ef10177a0 100644
--- a/lib/streamaggr/stddev.go
+++ b/lib/streamaggr/stddev.go
@@ -4,6 +4,7 @@ import (
"math"
"sync"
+ "github.com/VictoriaMetrics/VictoriaMetrics/lib/bytesutil"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/fasttime"
)
@@ -34,6 +35,7 @@ func (as *stddevAggrState) pushSamples(samples []pushSample) {
if !ok {
// The entry is missing in the map. Try creating it.
v = &stddevStateValue{}
+ outputKey = bytesutil.InternString(outputKey)
vNew, loaded := as.m.LoadOrStore(outputKey, v)
if loaded {
// Use the entry created by a concurrent goroutine.
diff --git a/lib/streamaggr/stdvar.go b/lib/streamaggr/stdvar.go
index c5d46af2a..dd4c21efe 100644
--- a/lib/streamaggr/stdvar.go
+++ b/lib/streamaggr/stdvar.go
@@ -3,6 +3,7 @@ package streamaggr
import (
"sync"
+ "github.com/VictoriaMetrics/VictoriaMetrics/lib/bytesutil"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/fasttime"
)
@@ -33,6 +34,7 @@ func (as *stdvarAggrState) pushSamples(samples []pushSample) {
if !ok {
// The entry is missing in the map. Try creating it.
v = &stdvarStateValue{}
+ outputKey = bytesutil.InternString(outputKey)
vNew, loaded := as.m.LoadOrStore(outputKey, v)
if loaded {
// Use the entry created by a concurrent goroutine.
diff --git a/lib/streamaggr/streamaggr.go b/lib/streamaggr/streamaggr.go
index 6657b2e04..92fdba57a 100644
--- a/lib/streamaggr/streamaggr.go
+++ b/lib/streamaggr/streamaggr.go
@@ -389,13 +389,20 @@ type aggregator struct {
flushDuration *metrics.Histogram
dedupFlushDuration *metrics.Histogram
+ samplesLag *metrics.Histogram
flushTimeouts *metrics.Counter
dedupFlushTimeouts *metrics.Counter
+ ignoredOldSamples *metrics.Counter
+ ignoredNanSamples *metrics.Counter
}
type aggrState interface {
+ // pushSamples must push samples to the aggrState.
+ //
+ // samples[].key must be cloned by aggrState, since it may change after returning from pushSamples.
pushSamples(samples []pushSample)
+
flushState(ctx *flushCtx, resetState bool)
}
@@ -610,9 +617,12 @@ func newAggregator(cfg *Config, pushFunc PushFunc, ms *metrics.Set, opts *Option
flushDuration: ms.GetOrCreateHistogram(`vm_streamaggr_flush_duration_seconds`),
dedupFlushDuration: ms.GetOrCreateHistogram(`vm_streamaggr_dedup_flush_duration_seconds`),
+ samplesLag: ms.GetOrCreateHistogram(`vm_streamaggr_samples_lag_seconds`),
flushTimeouts: ms.GetOrCreateCounter(`vm_streamaggr_flush_timeouts_total`),
dedupFlushTimeouts: ms.GetOrCreateCounter(`vm_streamaggr_dedup_flush_timeouts_total`),
+ ignoredNanSamples: ms.GetOrCreateCounter(`vm_streamaggr_ignored_samples_total{reason="nan"}`),
+ ignoredOldSamples: ms.GetOrCreateCounter(`vm_streamaggr_ignored_samples_total{reason="too_old"}`),
}
if dedupInterval > 0 {
a.da = newDedupAggr()
@@ -798,6 +808,7 @@ func (a *aggregator) MustStop() {
// Push pushes tss to a.
func (a *aggregator) Push(tss []prompbmarshal.TimeSeries, matchIdxs []byte) {
+ now := time.Now().UnixMilli()
ctx := getPushCtx()
defer putPushCtx(ctx)
@@ -810,6 +821,8 @@ func (a *aggregator) Push(tss []prompbmarshal.TimeSeries, matchIdxs []byte) {
dropLabels := a.dropInputLabels
ignoreOldSamples := a.ignoreOldSamples
minTimestamp := a.minTimestamp.Load()
+ var totalLag int64
+ var totalSamples int
for idx, ts := range tss {
if !a.match.Match(ts.Labels) {
continue
@@ -836,17 +849,24 @@ func (a *aggregator) Push(tss []prompbmarshal.TimeSeries, matchIdxs []byte) {
outputLabels.Labels = append(outputLabels.Labels, labels.Labels...)
}
- buf = compressLabels(buf[:0], inputLabels.Labels, outputLabels.Labels)
- key := bytesutil.InternBytes(buf)
+ bufLen := len(buf)
+ buf = compressLabels(buf, inputLabels.Labels, outputLabels.Labels)
+ // key remains valid only by the end of this function and can't be reused after
+ // do not intern key because number of unique keys could be too high
+ key := bytesutil.ToUnsafeString(buf[bufLen:])
for _, sample := range ts.Samples {
if math.IsNaN(sample.Value) {
+ a.ignoredNanSamples.Inc()
// Skip NaN values
continue
}
if ignoreOldSamples && sample.Timestamp < minTimestamp {
+ a.ignoredOldSamples.Inc()
// Skip old samples outside the current aggregation interval
continue
}
+ totalLag += now - sample.Timestamp
+ totalSamples++
samples = append(samples, pushSample{
key: key,
value: sample.Value,
@@ -854,6 +874,9 @@ func (a *aggregator) Push(tss []prompbmarshal.TimeSeries, matchIdxs []byte) {
})
}
}
+ if totalSamples > 0 {
+ a.samplesLag.Update(float64(totalLag/int64(totalSamples)) / 1000)
+ }
ctx.samples = samples
ctx.buf = buf
@@ -926,6 +949,8 @@ func (ctx *pushCtx) reset() {
}
type pushSample struct {
+ // key identifies a sample that belongs to unique series
+ // key value can't be re-used
key string
value float64
timestamp int64
diff --git a/lib/streamaggr/sum_samples.go b/lib/streamaggr/sum_samples.go
index bbd63fd0e..eb621ce5c 100644
--- a/lib/streamaggr/sum_samples.go
+++ b/lib/streamaggr/sum_samples.go
@@ -3,6 +3,7 @@ package streamaggr
import (
"sync"
+ "github.com/VictoriaMetrics/VictoriaMetrics/lib/bytesutil"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/fasttime"
)
@@ -33,6 +34,7 @@ func (as *sumSamplesAggrState) pushSamples(samples []pushSample) {
v = &sumSamplesStateValue{
sum: s.value,
}
+ outputKey = bytesutil.InternString(outputKey)
vNew, loaded := as.m.LoadOrStore(outputKey, v)
if !loaded {
// The new entry has been successfully created.
diff --git a/lib/streamaggr/total.go b/lib/streamaggr/total.go
index b53d326d3..365fdb35d 100644
--- a/lib/streamaggr/total.go
+++ b/lib/streamaggr/total.go
@@ -5,6 +5,7 @@ import (
"sync"
"time"
+ "github.com/VictoriaMetrics/VictoriaMetrics/lib/bytesutil"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/fasttime"
)
@@ -80,6 +81,7 @@ func (as *totalAggrState) pushSamples(samples []pushSample) {
v = &totalStateValue{
lastValues: make(map[string]totalLastValueState),
}
+ outputKey = bytesutil.InternString(outputKey)
vNew, loaded := as.m.LoadOrStore(outputKey, v)
if loaded {
// Use the entry created by a concurrent goroutine.
@@ -108,6 +110,8 @@ func (as *totalAggrState) pushSamples(samples []pushSample) {
lv.value = s.value
lv.timestamp = s.timestamp
lv.deleteDeadline = deleteDeadline
+
+ inputKey = bytesutil.InternString(inputKey)
sv.lastValues[inputKey] = lv
sv.deleteDeadline = deleteDeadline
}
diff --git a/lib/streamaggr/unique_samples.go b/lib/streamaggr/unique_samples.go
index 4f10b5c02..310617cc7 100644
--- a/lib/streamaggr/unique_samples.go
+++ b/lib/streamaggr/unique_samples.go
@@ -3,6 +3,7 @@ package streamaggr
import (
"sync"
+ "github.com/VictoriaMetrics/VictoriaMetrics/lib/bytesutil"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/fasttime"
)
@@ -35,6 +36,7 @@ func (as *uniqueSamplesAggrState) pushSamples(samples []pushSample) {
s.value: {},
},
}
+ outputKey = bytesutil.InternString(outputKey)
vNew, loaded := as.m.LoadOrStore(outputKey, v)
if !loaded {
// The new entry has been successfully created.
diff --git a/vendor/cloud.google.com/go/auth/CHANGES.md b/vendor/cloud.google.com/go/auth/CHANGES.md
index 1e7aa4798..7ef5fc0de 100644
--- a/vendor/cloud.google.com/go/auth/CHANGES.md
+++ b/vendor/cloud.google.com/go/auth/CHANGES.md
@@ -1,5 +1,19 @@
# Changelog
+## [0.5.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.5.0...auth/v0.5.1) (2024-05-31)
+
+
+### Bug Fixes
+
+* **auth:** Pass through client to 2LO and 3LO flows ([#10290](https://github.com/googleapis/google-cloud-go/issues/10290)) ([685784e](https://github.com/googleapis/google-cloud-go/commit/685784ea84358c15e9214bdecb307d37aa3b6d2f))
+
+## [0.5.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.4.2...auth/v0.5.0) (2024-05-28)
+
+
+### Features
+
+* **auth:** Adds X509 workload certificate provider ([#10233](https://github.com/googleapis/google-cloud-go/issues/10233)) ([17a9db7](https://github.com/googleapis/google-cloud-go/commit/17a9db73af35e3d1a7a25ac4fd1377a103de6150))
+
## [0.4.2](https://github.com/googleapis/google-cloud-go/compare/auth/v0.4.1...auth/v0.4.2) (2024-05-16)
diff --git a/vendor/cloud.google.com/go/auth/credentials/filetypes.go b/vendor/cloud.google.com/go/auth/credentials/filetypes.go
index a66e56d70..fe9355738 100644
--- a/vendor/cloud.google.com/go/auth/credentials/filetypes.go
+++ b/vendor/cloud.google.com/go/auth/credentials/filetypes.go
@@ -137,6 +137,7 @@ func handleServiceAccount(f *credsfile.ServiceAccountFile, opts *DetectOptions)
Scopes: opts.scopes(),
TokenURL: f.TokenURL,
Subject: opts.Subject,
+ Client: opts.client(),
}
if opts2LO.TokenURL == "" {
opts2LO.TokenURL = jwtTokenURL
@@ -154,6 +155,7 @@ func handleUserCredential(f *credsfile.UserCredentialsFile, opts *DetectOptions)
AuthStyle: auth.StyleInParams,
EarlyTokenExpiry: opts.EarlyTokenRefresh,
RefreshToken: f.RefreshToken,
+ Client: opts.client(),
}
return auth.New3LOTokenProvider(opts3LO)
}
diff --git a/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go b/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go
index 81c956b03..75bda4c63 100644
--- a/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go
+++ b/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go
@@ -47,7 +47,7 @@ var (
// Options used to configure a [GRPCClientConnPool] from [Dial].
type Options struct {
- // DisableTelemetry disables default telemetry (OpenCensus). An example
+ // DisableTelemetry disables default telemetry (OpenTelemetry). An example
// reason to do so would be to bind custom telemetry that overrides the
// defaults.
DisableTelemetry bool
diff --git a/vendor/cloud.google.com/go/auth/httptransport/httptransport.go b/vendor/cloud.google.com/go/auth/httptransport/httptransport.go
index 7fea9d87e..ef09c1b75 100644
--- a/vendor/cloud.google.com/go/auth/httptransport/httptransport.go
+++ b/vendor/cloud.google.com/go/auth/httptransport/httptransport.go
@@ -33,7 +33,7 @@ type ClientCertProvider = func(*tls.CertificateRequestInfo) (*tls.Certificate, e
// Options used to configure a [net/http.Client] from [NewClient].
type Options struct {
- // DisableTelemetry disables default telemetry (OpenCensus). An example
+ // DisableTelemetry disables default telemetry (OpenTelemetry). An example
// reason to do so would be to bind custom telemetry that overrides the
// defaults.
DisableTelemetry bool
diff --git a/vendor/cloud.google.com/go/auth/internal/transport/cert/workload_cert.go b/vendor/cloud.google.com/go/auth/internal/transport/cert/workload_cert.go
new file mode 100644
index 000000000..ea1e1febb
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/internal/transport/cert/workload_cert.go
@@ -0,0 +1,117 @@
+// Copyright 2024 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package cert
+
+import (
+ "crypto/tls"
+ "encoding/json"
+ "errors"
+ "io"
+ "os"
+
+ "github.com/googleapis/enterprise-certificate-proxy/client/util"
+)
+
+type certConfigs struct {
+ Workload *workloadSource `json:"workload"`
+}
+
+type workloadSource struct {
+ CertPath string `json:"cert_path"`
+ KeyPath string `json:"key_path"`
+}
+
+type certificateConfig struct {
+ CertConfigs certConfigs `json:"cert_configs"`
+}
+
+// NewWorkloadX509CertProvider creates a certificate source
+// that reads a certificate and private key file from the local file system.
+// This is intended to be used for workload identity federation.
+//
+// The configFilePath points to a config file containing relevant parameters
+// such as the certificate and key file paths.
+// If configFilePath is empty, the client will attempt to load the config from
+// a well-known gcloud location.
+func NewWorkloadX509CertProvider(configFilePath string) (Provider, error) {
+ if configFilePath == "" {
+ envFilePath := util.GetConfigFilePathFromEnv()
+ if envFilePath != "" {
+ configFilePath = envFilePath
+ } else {
+ configFilePath = util.GetDefaultConfigFilePath()
+ }
+ }
+
+ certFile, keyFile, err := getCertAndKeyFiles(configFilePath)
+ if err != nil {
+ return nil, err
+ }
+
+ source := &workloadSource{
+ CertPath: certFile,
+ KeyPath: keyFile,
+ }
+ return source.getClientCertificate, nil
+}
+
+// getClientCertificate attempts to load the certificate and key from the files specified in the
+// certificate config.
+func (s *workloadSource) getClientCertificate(info *tls.CertificateRequestInfo) (*tls.Certificate, error) {
+ cert, err := tls.LoadX509KeyPair(s.CertPath, s.KeyPath)
+ if err != nil {
+ return nil, err
+ }
+ return &cert, nil
+}
+
+// getCertAndKeyFiles attempts to read the provided config file and return the certificate and private
+// key file paths.
+func getCertAndKeyFiles(configFilePath string) (string, string, error) {
+ jsonFile, err := os.Open(configFilePath)
+ if err != nil {
+ if errors.Is(err, os.ErrNotExist) {
+ return "", "", errSourceUnavailable
+ }
+ return "", "", err
+ }
+
+ byteValue, err := io.ReadAll(jsonFile)
+ if err != nil {
+ return "", "", err
+ }
+
+ var config certificateConfig
+ if err := json.Unmarshal(byteValue, &config); err != nil {
+ return "", "", err
+ }
+
+ if config.CertConfigs.Workload == nil {
+ return "", "", errors.New("no Workload Identity Federation certificate information found in the certificate configuration file")
+ }
+
+ certFile := config.CertConfigs.Workload.CertPath
+ keyFile := config.CertConfigs.Workload.KeyPath
+
+ if certFile == "" {
+ return "", "", errors.New("certificate configuration is missing the certificate file location")
+ }
+
+ if keyFile == "" {
+ return "", "", errors.New("certificate configuration is missing the key file location")
+ }
+
+ return certFile, keyFile, nil
+}
diff --git a/vendor/cloud.google.com/go/internal/.repo-metadata-full.json b/vendor/cloud.google.com/go/internal/.repo-metadata-full.json
index beb47b516..655fc5d82 100644
--- a/vendor/cloud.google.com/go/internal/.repo-metadata-full.json
+++ b/vendor/cloud.google.com/go/internal/.repo-metadata-full.json
@@ -776,7 +776,7 @@
"language": "go",
"client_library_type": "generated",
"client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/commerce/latest/consumer/procurement/apiv1",
- "release_level": "preview",
+ "release_level": "stable",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/compute/apiv1": {
@@ -826,7 +826,7 @@
"language": "go",
"client_library_type": "generated",
"client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/config/latest/apiv1",
- "release_level": "preview",
+ "release_level": "stable",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/contactcenterinsights/apiv1": {
@@ -1666,7 +1666,7 @@
"language": "go",
"client_library_type": "generated",
"client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/migrationcenter/latest/apiv1",
- "release_level": "preview",
+ "release_level": "stable",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/monitoring/apiv3/v2": {
@@ -1706,7 +1706,7 @@
"language": "go",
"client_library_type": "generated",
"client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/netapp/latest/apiv1",
- "release_level": "preview",
+ "release_level": "stable",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/networkconnectivity/apiv1": {
@@ -2076,7 +2076,7 @@
"language": "go",
"client_library_type": "generated",
"client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/redis/latest/cluster/apiv1",
- "release_level": "preview",
+ "release_level": "stable",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/resourcemanager/apiv2": {
@@ -2219,6 +2219,16 @@
"release_level": "stable",
"library_type": "GAPIC_AUTO"
},
+ "cloud.google.com/go/security/publicca/apiv1": {
+ "api_shortname": "publicca",
+ "distribution_name": "cloud.google.com/go/security/publicca/apiv1",
+ "description": "Public Certificate Authority API",
+ "language": "go",
+ "client_library_type": "generated",
+ "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/security/latest/publicca/apiv1",
+ "release_level": "preview",
+ "library_type": "GAPIC_AUTO"
+ },
"cloud.google.com/go/security/publicca/apiv1beta1": {
"api_shortname": "publicca",
"distribution_name": "cloud.google.com/go/security/publicca/apiv1beta1",
@@ -2336,7 +2346,7 @@
"language": "go",
"client_library_type": "generated",
"client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/servicehealth/latest/apiv1",
- "release_level": "preview",
+ "release_level": "stable",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/servicemanagement/apiv1": {
@@ -2866,7 +2876,7 @@
"language": "go",
"client_library_type": "generated",
"client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/workstations/latest/apiv1",
- "release_level": "preview",
+ "release_level": "stable",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/workstations/apiv1beta": {
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md
index a6675492b..af095f1da 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md
@@ -1,5 +1,20 @@
# Release History
+## 1.12.0 (2024-06-06)
+
+### Features Added
+
+* Added field `StatusCodes` to `runtime.FetcherForNextLinkOptions` allowing for additional HTTP status codes indicating success.
+* Added func `NewUUID` to the `runtime` package for generating UUIDs.
+
+### Bugs Fixed
+
+* Fixed an issue that prevented pollers using the `Operation-Location` strategy from unmarshaling the final result in some cases.
+
+### Other Changes
+
+* Updated dependencies.
+
## 1.11.1 (2024-04-02)
### Bugs Fixed
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/async/async.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/async/async.go
index ccd4794e9..a53462760 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/async/async.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/async/async.go
@@ -155,5 +155,5 @@ func (p *Poller[T]) Result(ctx context.Context, out *T) error {
p.resp = resp
}
- return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), out)
+ return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), "", out)
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/body/body.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/body/body.go
index 0d781b31d..8751b0514 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/body/body.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/body/body.go
@@ -131,5 +131,5 @@ func (p *Poller[T]) Poll(ctx context.Context) (*http.Response, error) {
}
func (p *Poller[T]) Result(ctx context.Context, out *T) error {
- return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), out)
+ return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), "", out)
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/fake/fake.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/fake/fake.go
index 51aede8a2..7f8d11b8b 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/fake/fake.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/fake/fake.go
@@ -124,7 +124,7 @@ func (p *Poller[T]) Result(ctx context.Context, out *T) error {
return exported.NewResponseError(p.resp)
}
- return pollers.ResultHelper(p.resp, poller.Failed(p.FakeStatus), out)
+ return pollers.ResultHelper(p.resp, poller.Failed(p.FakeStatus), "", out)
}
// SanitizePollerPath removes any fake-appended suffix from a URL's path.
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/loc/loc.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/loc/loc.go
index 7a56c5211..048285275 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/loc/loc.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/loc/loc.go
@@ -119,5 +119,5 @@ func (p *Poller[T]) Poll(ctx context.Context) (*http.Response, error) {
}
func (p *Poller[T]) Result(ctx context.Context, out *T) error {
- return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), out)
+ return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), "", out)
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/op/op.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/op/op.go
index ac1c0efb5..03699fd76 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/op/op.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/op/op.go
@@ -115,10 +115,13 @@ func (p *Poller[T]) Poll(ctx context.Context) (*http.Response, error) {
func (p *Poller[T]) Result(ctx context.Context, out *T) error {
var req *exported.Request
var err error
+
+ // when the payload is included with the status monitor on
+ // terminal success it's in the "result" JSON property
+ payloadPath := "result"
+
if p.FinalState == pollers.FinalStateViaLocation && p.LocURL != "" {
req, err = exported.NewRequest(ctx, http.MethodGet, p.LocURL)
- } else if p.FinalState == pollers.FinalStateViaOpLocation && p.Method == http.MethodPost {
- // no final GET required, terminal response should have it
} else if rl, rlErr := poller.GetResourceLocation(p.resp); rlErr != nil && !errors.Is(rlErr, poller.ErrNoBody) {
return rlErr
} else if rl != "" {
@@ -134,6 +137,8 @@ func (p *Poller[T]) Result(ctx context.Context, out *T) error {
// if a final GET request has been created, execute it
if req != nil {
+ // no JSON path when making a final GET request
+ payloadPath = ""
resp, err := p.pl.Do(req)
if err != nil {
return err
@@ -141,5 +146,5 @@ func (p *Poller[T]) Result(ctx context.Context, out *T) error {
p.resp = resp
}
- return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), out)
+ return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), payloadPath, out)
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/util.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/util.go
index eb3cf651d..6a7a32e03 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/util.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/util.go
@@ -159,7 +159,7 @@ func PollHelper(ctx context.Context, endpoint string, pl azexported.Pipeline, up
// ResultHelper processes the response as success or failure.
// In the success case, it unmarshals the payload into either a new instance of T or out.
// In the failure case, it creates an *azcore.Response error from the response.
-func ResultHelper[T any](resp *http.Response, failed bool, out *T) error {
+func ResultHelper[T any](resp *http.Response, failed bool, jsonPath string, out *T) error {
// short-circuit the simple success case with no response body to unmarshal
if resp.StatusCode == http.StatusNoContent {
return nil
@@ -176,6 +176,18 @@ func ResultHelper[T any](resp *http.Response, failed bool, out *T) error {
if err != nil {
return err
}
+
+ if jsonPath != "" && len(payload) > 0 {
+ // extract the payload from the specified JSON path.
+ // do this before the zero-length check in case there
+ // is no payload.
+ jsonBody := map[string]json.RawMessage{}
+ if err = json.Unmarshal(payload, &jsonBody); err != nil {
+ return err
+ }
+ payload = jsonBody[jsonPath]
+ }
+
if len(payload) == 0 {
return nil
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go
index 03691cbf0..79651fd96 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go
@@ -40,5 +40,5 @@ const (
Module = "azcore"
// Version is the semantic version (see http://semver.org) of this module.
- Version = "v1.11.1"
+ Version = "v1.12.0"
)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/pager.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/pager.go
index cffe692d7..b960cff0b 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/pager.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/pager.go
@@ -94,6 +94,10 @@ type FetcherForNextLinkOptions struct {
// NextReq is the func to be called when requesting subsequent pages.
// Used for paged operations that have a custom next link operation.
NextReq func(context.Context, string) (*policy.Request, error)
+
+ // StatusCodes contains additional HTTP status codes indicating success.
+ // The default value is http.StatusOK.
+ StatusCodes []int
}
// FetcherForNextLink is a helper containing boilerplate code to simplify creating a PagingHandler[T].Fetcher from a next link URL.
@@ -105,10 +109,13 @@ type FetcherForNextLinkOptions struct {
func FetcherForNextLink(ctx context.Context, pl Pipeline, nextLink string, firstReq func(context.Context) (*policy.Request, error), options *FetcherForNextLinkOptions) (*http.Response, error) {
var req *policy.Request
var err error
+ if options == nil {
+ options = &FetcherForNextLinkOptions{}
+ }
if nextLink == "" {
req, err = firstReq(ctx)
} else if nextLink, err = EncodeQueryParams(nextLink); err == nil {
- if options != nil && options.NextReq != nil {
+ if options.NextReq != nil {
req, err = options.NextReq(ctx, nextLink)
} else {
req, err = NewRequest(ctx, http.MethodGet, nextLink)
@@ -121,7 +128,9 @@ func FetcherForNextLink(ctx context.Context, pl Pipeline, nextLink string, first
if err != nil {
return nil, err
}
- if !HasStatusCode(resp, http.StatusOK) {
+ successCodes := []int{http.StatusOK}
+ successCodes = append(successCodes, options.StatusCodes...)
+ if !HasStatusCode(resp, successCodes...) {
return nil, NewResponseError(resp)
}
return resp, nil
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/request.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/request.go
index 06ac95b1b..40ddc8d92 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/request.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/request.go
@@ -24,6 +24,7 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming"
+ "github.com/Azure/azure-sdk-for-go/sdk/internal/uuid"
)
// Base64Encoding is usesd to specify which base-64 encoder/decoder to use when
@@ -263,3 +264,12 @@ func SkipBodyDownload(req *policy.Request) {
// CtxAPINameKey is used as a context key for adding/retrieving the API name.
type CtxAPINameKey = shared.CtxAPINameKey
+
+// NewUUID returns a new UUID using the RFC4122 algorithm.
+func NewUUID() (string, error) {
+ u, err := uuid.New()
+ if err != nil {
+ return "", err
+ }
+ return u.String(), nil
+}
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/endpoints.go
index aa10a9b40..99edbf3ee 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/aws/endpoints.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/endpoints.go
@@ -70,6 +70,10 @@ func GetUseFIPSEndpoint(options ...interface{}) (value FIPSEndpointState, found
// The SDK will automatically resolve these endpoints per API client using an
// internal endpoint resolvers. If you'd like to provide custom endpoint
// resolving behavior you can implement the EndpointResolver interface.
+//
+// Deprecated: This structure was used with the global [EndpointResolver]
+// interface, which has been deprecated in favor of service-specific endpoint
+// resolution. See the deprecation docs on that interface for more information.
type Endpoint struct {
// The base URL endpoint the SDK API clients will use to make API calls to.
// The SDK will suffix URI path and query elements to this endpoint.
@@ -124,6 +128,8 @@ type Endpoint struct {
}
// EndpointSource is the endpoint source type.
+//
+// Deprecated: The global [Endpoint] structure is deprecated.
type EndpointSource int
const (
@@ -161,19 +167,25 @@ func (e *EndpointNotFoundError) Unwrap() error {
// API clients will fallback to attempting to resolve the endpoint using its
// internal default endpoint resolver.
//
-// Deprecated: See EndpointResolverWithOptions
+// Deprecated: The global endpoint resolution interface is deprecated. The API
+// for endpoint resolution is now unique to each service and is set via the
+// EndpointResolverV2 field on service client options. Setting a value for
+// EndpointResolver on aws.Config or service client options will prevent you
+// from using any endpoint-related service features released after the
+// introduction of EndpointResolverV2. You may also encounter broken or
+// unexpected behavior when using the old global interface with services that
+// use many endpoint-related customizations such as S3.
type EndpointResolver interface {
ResolveEndpoint(service, region string) (Endpoint, error)
}
// EndpointResolverFunc wraps a function to satisfy the EndpointResolver interface.
//
-// Deprecated: See EndpointResolverWithOptionsFunc
+// Deprecated: The global endpoint resolution interface is deprecated. See
+// deprecation docs on [EndpointResolver].
type EndpointResolverFunc func(service, region string) (Endpoint, error)
// ResolveEndpoint calls the wrapped function and returns the results.
-//
-// Deprecated: See EndpointResolverWithOptions.ResolveEndpoint
func (e EndpointResolverFunc) ResolveEndpoint(service, region string) (Endpoint, error) {
return e(service, region)
}
@@ -184,11 +196,17 @@ func (e EndpointResolverFunc) ResolveEndpoint(service, region string) (Endpoint,
// available. If the EndpointResolverWithOptions returns an EndpointNotFoundError error,
// API clients will fallback to attempting to resolve the endpoint using its
// internal default endpoint resolver.
+//
+// Deprecated: The global endpoint resolution interface is deprecated. See
+// deprecation docs on [EndpointResolver].
type EndpointResolverWithOptions interface {
ResolveEndpoint(service, region string, options ...interface{}) (Endpoint, error)
}
// EndpointResolverWithOptionsFunc wraps a function to satisfy the EndpointResolverWithOptions interface.
+//
+// Deprecated: The global endpoint resolution interface is deprecated. See
+// deprecation docs on [EndpointResolver].
type EndpointResolverWithOptionsFunc func(service, region string, options ...interface{}) (Endpoint, error)
// ResolveEndpoint calls the wrapped function and returns the results.
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go
index e648346be..d9cd55e74 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go
@@ -3,4 +3,4 @@
package aws
// goModuleVersion is the tagged release for this module
-const goModuleVersion = "1.27.0"
+const goModuleVersion = "1.27.1"
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.go
index ca738f234..71b1a3521 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.go
@@ -38,7 +38,6 @@ var RequiredSignedHeaders = Rules{
"X-Amz-Copy-Source-Server-Side-Encryption-Customer-Algorithm": struct{}{},
"X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key": struct{}{},
"X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key-Md5": struct{}{},
- "X-Amz-Expected-Bucket-Owner": struct{}{},
"X-Amz-Grant-Full-control": struct{}{},
"X-Amz-Grant-Read": struct{}{},
"X-Amz-Grant-Read-Acp": struct{}{},
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.go
index 55dfd07ba..dcd896a9b 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.go
@@ -395,6 +395,12 @@ func buildQuery(r v4Internal.Rule, header http.Header) (url.Values, http.Header)
query := url.Values{}
unsignedHeaders := http.Header{}
for k, h := range header {
+ // literally just this header has this constraint for some stupid reason,
+ // see #2508
+ if k == "X-Amz-Expected-Bucket-Owner" {
+ k = "x-amz-expected-bucket-owner"
+ }
+
if r.IsValid(k) {
query[k] = h
} else {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md
index ff8ccb9fa..a1bbe100f 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md
+++ b/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md
@@ -1,3 +1,12 @@
+# v1.27.17 (2024-06-03)
+
+* **Documentation**: Add deprecation docs to global endpoint resolution interfaces. These APIs were previously deprecated with the introduction of service-specific endpoint resolution (EndpointResolverV2 and BaseEndpoint on service client options).
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.27.16 (2024-05-23)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
# v1.27.15 (2024-05-16)
* **Dependency Update**: Updated to the latest SDK module versions
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go
index 7300e7a88..089c79b28 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go
@@ -3,4 +3,4 @@
package config
// goModuleVersion is the tagged release for this module
-const goModuleVersion = "1.27.15"
+const goModuleVersion = "1.27.17"
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/load_options.go b/vendor/github.com/aws/aws-sdk-go-v2/config/load_options.go
index 06596c1b7..7ff38b9da 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/config/load_options.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/config/load_options.go
@@ -824,7 +824,14 @@ func (o LoadOptions) getEndpointResolver(ctx context.Context) (aws.EndpointResol
// the EndpointResolver value is ignored. If multiple WithEndpointResolver calls
// are made, the last call overrides the previous call values.
//
-// Deprecated: See WithEndpointResolverWithOptions
+// Deprecated: The global endpoint resolution interface is deprecated. The API
+// for endpoint resolution is now unique to each service and is set via the
+// EndpointResolverV2 field on service client options. Use of
+// WithEndpointResolver or WithEndpointResolverWithOptions will prevent you
+// from using any endpoint-related service features released after the
+// introduction of EndpointResolverV2. You may also encounter broken or
+// unexpected behavior when using the old global interface with services that
+// use many endpoint-related customizations such as S3.
func WithEndpointResolver(v aws.EndpointResolver) LoadOptionsFunc {
return func(o *LoadOptions) error {
o.EndpointResolver = v
@@ -844,6 +851,9 @@ func (o LoadOptions) getEndpointResolverWithOptions(ctx context.Context) (aws.En
// that sets the EndpointResolverWithOptions on LoadOptions. If the EndpointResolverWithOptions is set to nil,
// the EndpointResolver value is ignored. If multiple WithEndpointResolver calls
// are made, the last call overrides the previous call values.
+//
+// Deprecated: The global endpoint resolution interface is deprecated. See
+// deprecation docs on [WithEndpointResolver].
func WithEndpointResolverWithOptions(v aws.EndpointResolverWithOptions) LoadOptionsFunc {
return func(o *LoadOptions) error {
o.EndpointResolverWithOptions = v
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md
index d70fbf9c5..2919c2a5f 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md
+++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md
@@ -1,3 +1,11 @@
+# v1.17.17 (2024-06-03)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.17.16 (2024-05-23)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
# v1.17.15 (2024-05-16)
* **Dependency Update**: Updated to the latest SDK module versions
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go
index 785a5d003..41ea238d9 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go
@@ -3,4 +3,4 @@
package credentials
// goModuleVersion is the tagged release for this module
-const goModuleVersion = "1.17.15"
+const goModuleVersion = "1.17.17"
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md
index 15f2dff92..d99db87e7 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md
+++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md
@@ -1,3 +1,7 @@
+# v1.16.4 (2024-06-03)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
# v1.16.3 (2024-05-16)
* **Dependency Update**: Updated to the latest SDK module versions
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go
index 18c7d54f8..82062118d 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go
@@ -3,4 +3,4 @@
package imds
// goModuleVersion is the tagged release for this module
-const goModuleVersion = "1.16.3"
+const goModuleVersion = "1.16.4"
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/CHANGELOG.md
index 57f169ddf..a0175faa4 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/CHANGELOG.md
+++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/CHANGELOG.md
@@ -1,3 +1,15 @@
+# v1.16.23 (2024-06-05)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.16.22 (2024-06-03)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.16.21 (2024-05-23)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
# v1.16.20 (2024-05-16)
* **Dependency Update**: Updated to the latest SDK module versions
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/go_module_metadata.go
index 01f6fe316..c2160609c 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/go_module_metadata.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/go_module_metadata.go
@@ -3,4 +3,4 @@
package manager
// goModuleVersion is the tagged release for this module
-const goModuleVersion = "1.16.20"
+const goModuleVersion = "1.16.23"
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md
index e5ab27663..0c5a35db9 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md
+++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md
@@ -1,3 +1,7 @@
+# v1.3.8 (2024-06-03)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
# v1.3.7 (2024-05-16)
* **Dependency Update**: Updated to the latest SDK module versions
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go
index 67cbc3767..902f50d69 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go
@@ -3,4 +3,4 @@
package configsources
// goModuleVersion is the tagged release for this module
-const goModuleVersion = "1.3.7"
+const goModuleVersion = "1.3.8"
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json
index f376f6908..7a28569c3 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json
+++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json
@@ -198,7 +198,11 @@
"supportsFIPS" : true
},
"regionRegex" : "^eu\\-isoe\\-\\w+\\-\\d+$",
- "regions" : { }
+ "regions" : {
+ "eu-isoe-west-1" : {
+ "description" : "EU ISOE West"
+ }
+ }
}, {
"id" : "aws-iso-f",
"outputs" : {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md
index 5ff8fef93..c9ef13fc6 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md
+++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md
@@ -1,3 +1,7 @@
+# v2.6.8 (2024-06-03)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
# v2.6.7 (2024-05-16)
* **Dependency Update**: Updated to the latest SDK module versions
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go
index cc9b78076..91cd333da 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go
@@ -3,4 +3,4 @@
package endpoints
// goModuleVersion is the tagged release for this module
-const goModuleVersion = "2.6.7"
+const goModuleVersion = "2.6.8"
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/CHANGELOG.md
index c9e75845e..1dd291857 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/CHANGELOG.md
+++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/CHANGELOG.md
@@ -1,3 +1,7 @@
+# v1.3.8 (2024-06-03)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
# v1.3.7 (2024-05-16)
* **Dependency Update**: Updated to the latest SDK module versions
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/go_module_metadata.go
index 3ad7fe2ad..eabc13fa5 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/go_module_metadata.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/go_module_metadata.go
@@ -3,4 +3,4 @@
package v4a
// goModuleVersion is the tagged release for this module
-const goModuleVersion = "1.3.7"
+const goModuleVersion = "1.3.8"
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/CHANGELOG.md
index bb5f3faa7..37b203f1f 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/CHANGELOG.md
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/CHANGELOG.md
@@ -1,3 +1,7 @@
+# v1.3.10 (2024-06-03)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
# v1.3.9 (2024-05-16)
* **Dependency Update**: Updated to the latest SDK module versions
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/go_module_metadata.go
index fffd7ee8f..05f636dab 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/go_module_metadata.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/go_module_metadata.go
@@ -3,4 +3,4 @@
package checksum
// goModuleVersion is the tagged release for this module
-const goModuleVersion = "1.3.9"
+const goModuleVersion = "1.3.10"
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md
index 606704521..0c98ab7cd 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md
@@ -1,3 +1,7 @@
+# v1.11.10 (2024-06-03)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
# v1.11.9 (2024-05-16)
* **Dependency Update**: Updated to the latest SDK module versions
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go
index 24fd480d3..d1a66df08 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go
@@ -3,4 +3,4 @@
package presignedurl
// goModuleVersion is the tagged release for this module
-const goModuleVersion = "1.11.9"
+const goModuleVersion = "1.11.10"
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/CHANGELOG.md
index 71d59349f..d8d906641 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/CHANGELOG.md
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/CHANGELOG.md
@@ -1,3 +1,7 @@
+# v1.17.8 (2024-06-03)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
# v1.17.7 (2024-05-16)
* **Dependency Update**: Updated to the latest SDK module versions
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/go_module_metadata.go
index 74be6efe1..f6e216e31 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/go_module_metadata.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/go_module_metadata.go
@@ -3,4 +3,4 @@
package s3shared
// goModuleVersion is the tagged release for this module
-const goModuleVersion = "1.17.7"
+const goModuleVersion = "1.17.8"
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/CHANGELOG.md
index 4d9957a68..6482a0a1d 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/CHANGELOG.md
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/CHANGELOG.md
@@ -1,3 +1,16 @@
+# v1.55.0 (2024-06-05)
+
+* **Feature**: Added new params copySource and key to copyObject API for supporting S3 Access Grants plugin. These changes will not change any of the existing S3 API functionality.
+* **Bug Fix**: Add S3-specific smithy protocol tests.
+
+# v1.54.4 (2024-06-03)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.54.3 (2024-05-23)
+
+* **Bug Fix**: Prevent parsing failures for nonstandard `Expires` values in responses. If the SDK cannot parse the value set in the response header for this field it will now be returned as `nil`. A new field, `ExpiresString`, has been added that will retain the unparsed value from the response (regardless of whether it came back in a format recognized by the SDK).
+
# v1.54.2 (2024-05-16)
* **Dependency Update**: Updated to the latest SDK module versions
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CopyObject.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CopyObject.go
index bae0b7cb4..824a9c816 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CopyObject.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CopyObject.go
@@ -736,6 +736,8 @@ type CopyObjectInput struct {
func (in *CopyObjectInput) bindEndpointParams(p *EndpointParameters) {
p.Bucket = in.Bucket
+ p.CopySource = in.CopySource
+ p.Key = in.Key
p.DisableS3ExpressSessionAuth = ptr.Bool(true)
}
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObject.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObject.go
index 80edddd15..4ca0b5b46 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObject.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObject.go
@@ -505,8 +505,16 @@ type GetObjectOutput struct {
Expiration *string
// The date and time at which the object is no longer cacheable.
+ //
+ // Deprecated: This field is handled inconsistently across AWS SDKs. Prefer using
+ // the ExpiresString field which contains the unparsed value from the service
+ // response.
Expires *time.Time
+ // The unparsed value of the Expires field from the service response. Prefer use
+ // of this value over the normal Expires response field where possible.
+ ExpiresString *string
+
// Date and time when the object was last modified.
//
// General purpose buckets - When you specify a versionId of the object in your
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_HeadObject.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_HeadObject.go
index ddddfe5c1..7152daf07 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_HeadObject.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_HeadObject.go
@@ -426,8 +426,16 @@ type HeadObjectOutput struct {
Expiration *string
// The date and time at which the object is no longer cacheable.
+ //
+ // Deprecated: This field is handled inconsistently across AWS SDKs. Prefer using
+ // the ExpiresString field which contains the unparsed value from the service
+ // response.
Expires *time.Time
+ // The unparsed value of the Expires field from the service response. Prefer use
+ // of this value over the normal Expires response field where possible.
+ ExpiresString *string
+
// Date and time when the object was last modified.
LastModified *time.Time
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/deserializers.go
index 2be5df30f..d953cdc1c 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/deserializers.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/deserializers.go
@@ -25,8 +25,17 @@ import (
"io/ioutil"
"strconv"
"strings"
+ "time"
)
+func deserializeS3Expires(v string) (*time.Time, error) {
+ t, err := smithytime.ParseHTTPDate(v)
+ if err != nil {
+ return nil, nil
+ }
+ return &t, nil
+}
+
type awsRestxml_deserializeOpAbortMultipartUpload struct {
}
@@ -5504,12 +5513,17 @@ func awsRestxml_deserializeOpHttpBindingsGetObjectOutput(v *GetObjectOutput, res
}
if headerValues := response.Header.Values("Expires"); len(headerValues) != 0 {
- headerValues[0] = strings.TrimSpace(headerValues[0])
- t, err := smithytime.ParseHTTPDate(headerValues[0])
+ deserOverride, err := deserializeS3Expires(headerValues[0])
if err != nil {
return err
}
- v.Expires = ptr.Time(t)
+ v.Expires = deserOverride
+
+ }
+
+ if headerValues := response.Header.Values("Expires"); len(headerValues) != 0 {
+ headerValues[0] = strings.TrimSpace(headerValues[0])
+ v.ExpiresString = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("Last-Modified"); len(headerValues) != 0 {
@@ -7128,12 +7142,17 @@ func awsRestxml_deserializeOpHttpBindingsHeadObjectOutput(v *HeadObjectOutput, r
}
if headerValues := response.Header.Values("Expires"); len(headerValues) != 0 {
- headerValues[0] = strings.TrimSpace(headerValues[0])
- t, err := smithytime.ParseHTTPDate(headerValues[0])
+ deserOverride, err := deserializeS3Expires(headerValues[0])
if err != nil {
return err
}
- v.Expires = ptr.Time(t)
+ v.Expires = deserOverride
+
+ }
+
+ if headerValues := response.Header.Values("Expires"); len(headerValues) != 0 {
+ headerValues[0] = strings.TrimSpace(headerValues[0])
+ v.ExpiresString = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("Last-Modified"); len(headerValues) != 0 {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/endpoints.go
index e6ae2e872..39f416bcf 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/endpoints.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/endpoints.go
@@ -326,6 +326,13 @@ type EndpointParameters struct {
// is required.
Prefix *string
+ // The Copy Source used for Copy Object request. This is an optional parameter that
+ // will be set automatically for operations that are scoped to Copy
+ // Source.
+ //
+ // Parameter is required.
+ CopySource *string
+
// Internal parameter to disable Access Point Buckets
//
// Parameter is required.
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/go_module_metadata.go
index ac25c831b..a3c32d724 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/go_module_metadata.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/go_module_metadata.go
@@ -3,4 +3,4 @@
package s3
// goModuleVersion is the tagged release for this module
-const goModuleVersion = "1.54.2"
+const goModuleVersion = "1.55.0"
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md
index f5f7d5a22..cb6d9d596 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md
@@ -1,3 +1,11 @@
+# v1.20.10 (2024-06-03)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.20.9 (2024-05-23)
+
+* No change notes available for this release.
+
# v1.20.8 (2024-05-16)
* **Dependency Update**: Updated to the latest SDK module versions
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.go
index 8bba205f4..d6297fa6a 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.go
@@ -13,12 +13,22 @@ import (
smithyio "github.com/aws/smithy-go/io"
"github.com/aws/smithy-go/middleware"
"github.com/aws/smithy-go/ptr"
+ smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
"io/ioutil"
"strings"
+ "time"
)
+func deserializeS3Expires(v string) (*time.Time, error) {
+ t, err := smithytime.ParseHTTPDate(v)
+ if err != nil {
+ return nil, nil
+ }
+ return &t, nil
+}
+
type awsRestjson1_deserializeOpGetRoleCredentials struct {
}
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go
index 66ee5a4ce..5947e4981 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go
@@ -3,4 +3,4 @@
package sso
// goModuleVersion is the tagged release for this module
-const goModuleVersion = "1.20.8"
+const goModuleVersion = "1.20.10"
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md
index f5591a7d3..a8a7f8fe6 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md
@@ -1,3 +1,11 @@
+# v1.24.4 (2024-06-03)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.24.3 (2024-05-23)
+
+* No change notes available for this release.
+
# v1.24.2 (2024-05-16)
* **Dependency Update**: Updated to the latest SDK module versions
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go
index b70e5fb5a..05e8c6b7e 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go
@@ -13,11 +13,21 @@ import (
smithyio "github.com/aws/smithy-go/io"
"github.com/aws/smithy-go/middleware"
"github.com/aws/smithy-go/ptr"
+ smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
"strings"
+ "time"
)
+func deserializeS3Expires(v string) (*time.Time, error) {
+ t, err := smithytime.ParseHTTPDate(v)
+ if err != nil {
+ return nil, nil
+ }
+ return &t, nil
+}
+
type awsRestjson1_deserializeOpCreateToken struct {
}
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go
index f699d84bb..b1403a826 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go
@@ -3,4 +3,4 @@
package ssooidc
// goModuleVersion is the tagged release for this module
-const goModuleVersion = "1.24.2"
+const goModuleVersion = "1.24.4"
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md
index 2f8900987..24fe77f32 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md
@@ -1,3 +1,11 @@
+# v1.28.11 (2024-06-03)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.28.10 (2024-05-23)
+
+* No change notes available for this release.
+
# v1.28.9 (2024-05-16)
* **Dependency Update**: Updated to the latest SDK module versions
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go
index 5d634ce35..7e4346ec9 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go
@@ -20,8 +20,17 @@ import (
"io"
"strconv"
"strings"
+ "time"
)
+func deserializeS3Expires(v string) (*time.Time, error) {
+ t, err := smithytime.ParseHTTPDate(v)
+ if err != nil {
+ return nil, nil
+ }
+ return &t, nil
+}
+
type awsAwsquery_deserializeOpAssumeRole struct {
}
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go
index 5583e60cc..08c29ce32 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go
@@ -3,4 +3,4 @@
package sts
// goModuleVersion is the tagged release for this module
-const goModuleVersion = "1.28.9"
+const goModuleVersion = "1.28.11"
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go
index 2d6ed505a..ec06aeb05 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go
@@ -74,7 +74,9 @@ const (
)
// AWS ISOE (Europe) partition's regions.
-const ()
+const (
+ EuIsoeWest1RegionID = "eu-isoe-west-1" // EU ISOE West.
+)
// AWS ISOF partition's regions.
const ()
@@ -244,13 +246,6 @@ var awsPartition = partition{
},
},
Services: services{
- "a4b": service{
- Endpoints: serviceEndpoints{
- endpointKey{
- Region: "us-east-1",
- }: endpoint{},
- },
- },
"access-analyzer": service{
Endpoints: serviceEndpoints{
endpointKey{
@@ -5055,6 +5050,9 @@ var awsPartition = partition{
},
"braket": service{
Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "eu-north-1",
+ }: endpoint{},
endpointKey{
Region: "eu-west-2",
}: endpoint{},
@@ -5299,69 +5297,157 @@ var awsPartition = partition{
endpointKey{
Region: "af-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "af-south-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "ap-east-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-east-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "ap-northeast-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "ap-northeast-2",
}: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-2",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "ap-northeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-3",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "ap-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-south-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "ap-southeast-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "ap-southeast-2",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-2",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-central-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "eu-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-central-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "eu-north-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-north-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "eu-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-south-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "eu-west-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-west-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "eu-west-2",
}: endpoint{},
+ endpointKey{
+ Region: "eu-west-2",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "eu-west-3",
}: endpoint{},
+ endpointKey{
+ Region: "eu-west-3",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "il-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "il-central-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "me-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "me-south-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "sa-east-1",
}: endpoint{},
+ endpointKey{
+ Region: "sa-east-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "us-east-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-east-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "us-east-2",
}: endpoint{},
+ endpointKey{
+ Region: "us-east-2",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "us-west-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-west-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "us-west-2",
}: endpoint{},
+ endpointKey{
+ Region: "us-west-2",
+ Variant: dualStackVariant,
+ }: endpoint{},
},
},
"cloudcontrolapi": service{
@@ -9266,9 +9352,21 @@ var awsPartition = partition{
endpointKey{
Region: "ca-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-central-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "directconnect-fips.ca-central-1.amazonaws.com",
+ },
endpointKey{
Region: "ca-west-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "directconnect-fips.ca-west-1.amazonaws.com",
+ },
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -9293,6 +9391,24 @@ var awsPartition = partition{
endpointKey{
Region: "eu-west-3",
}: endpoint{},
+ endpointKey{
+ Region: "fips-ca-central-1",
+ }: endpoint{
+ Hostname: "directconnect-fips.ca-central-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-central-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-ca-west-1",
+ }: endpoint{
+ Hostname: "directconnect-fips.ca-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "fips-us-east-1",
}: endpoint{
@@ -15441,13 +15557,6 @@ var awsPartition = partition{
}: endpoint{},
},
},
- "honeycode": service{
- Endpoints: serviceEndpoints{
- endpointKey{
- Region: "us-west-2",
- }: endpoint{},
- },
- },
"iam": service{
PartitionEndpoint: "aws-global",
IsRegionalized: boxedFalse,
@@ -15570,6 +15679,9 @@ var awsPartition = partition{
endpointKey{
Region: "ca-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -24101,6 +24213,9 @@ var awsPartition = partition{
},
"quicksight": service{
Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "af-south-1",
+ }: endpoint{},
endpointKey{
Region: "ap-northeast-1",
}: endpoint{},
@@ -24116,15 +24231,27 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-2",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-3",
+ }: endpoint{},
+ endpointKey{
+ Region: "api",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
endpointKey{
Region: "eu-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-central-2",
+ }: endpoint{},
endpointKey{
Region: "eu-north-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-south-1",
+ }: endpoint{},
endpointKey{
Region: "eu-west-1",
}: endpoint{},
@@ -25172,9 +25299,15 @@ var awsPartition = partition{
endpointKey{
Region: "eu-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-central-2",
+ }: endpoint{},
endpointKey{
Region: "eu-north-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-south-2",
+ }: endpoint{},
endpointKey{
Region: "eu-west-1",
}: endpoint{},
@@ -25229,6 +25362,9 @@ var awsPartition = partition{
},
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "sa-east-1",
+ }: endpoint{},
endpointKey{
Region: "us-east-1",
}: endpoint{},
@@ -33778,6 +33914,9 @@ var awsPartition = partition{
endpointKey{
Region: "eu-west-2",
}: endpoint{},
+ endpointKey{
+ Region: "eu-west-3",
+ }: endpoint{},
endpointKey{
Region: "sa-east-1",
}: endpoint{},
@@ -33787,6 +33926,9 @@ var awsPartition = partition{
endpointKey{
Region: "us-east-2",
}: endpoint{},
+ endpointKey{
+ Region: "us-west-1",
+ }: endpoint{},
endpointKey{
Region: "us-west-2",
}: endpoint{},
@@ -37367,6 +37509,9 @@ var awscnPartition = partition{
endpointKey{
Region: "cn-north-1",
}: endpoint{},
+ endpointKey{
+ Region: "cn-northwest-1",
+ }: endpoint{},
},
},
"resource-groups": service{
@@ -45725,42 +45870,12 @@ var awsisoPartition = partition{
},
"ram": service{
Endpoints: serviceEndpoints{
- endpointKey{
- Region: "fips-us-iso-east-1",
- }: endpoint{
- Hostname: "ram-fips.us-iso-east-1.c2s.ic.gov",
- CredentialScope: credentialScope{
- Region: "us-iso-east-1",
- },
- Deprecated: boxedTrue,
- },
- endpointKey{
- Region: "fips-us-iso-west-1",
- }: endpoint{
- Hostname: "ram-fips.us-iso-west-1.c2s.ic.gov",
- CredentialScope: credentialScope{
- Region: "us-iso-west-1",
- },
- Deprecated: boxedTrue,
- },
endpointKey{
Region: "us-iso-east-1",
}: endpoint{},
- endpointKey{
- Region: "us-iso-east-1",
- Variant: fipsVariant,
- }: endpoint{
- Hostname: "ram-fips.us-iso-east-1.c2s.ic.gov",
- },
endpointKey{
Region: "us-iso-west-1",
}: endpoint{},
- endpointKey{
- Region: "us-iso-west-1",
- Variant: fipsVariant,
- }: endpoint{
- Hostname: "ram-fips.us-iso-west-1.c2s.ic.gov",
- },
},
},
"rbin": service{
@@ -45805,37 +45920,10 @@ var awsisoPartition = partition{
},
"rds": service{
Endpoints: serviceEndpoints{
- endpointKey{
- Region: "rds-fips.us-iso-east-1",
- }: endpoint{
- Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov",
- CredentialScope: credentialScope{
- Region: "us-iso-east-1",
- },
- Deprecated: boxedTrue,
- },
- endpointKey{
- Region: "rds-fips.us-iso-west-1",
- }: endpoint{
- Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov",
- CredentialScope: credentialScope{
- Region: "us-iso-west-1",
- },
- Deprecated: boxedTrue,
- },
endpointKey{
Region: "rds.us-iso-east-1",
}: endpoint{
- CredentialScope: credentialScope{
- Region: "us-iso-east-1",
- },
- Deprecated: boxedTrue,
- },
- endpointKey{
- Region: "rds.us-iso-east-1",
- Variant: fipsVariant,
- }: endpoint{
- Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov",
+ Hostname: "rds.us-iso-east-1.c2s.ic.gov",
CredentialScope: credentialScope{
Region: "us-iso-east-1",
},
@@ -45844,16 +45932,7 @@ var awsisoPartition = partition{
endpointKey{
Region: "rds.us-iso-west-1",
}: endpoint{
- CredentialScope: credentialScope{
- Region: "us-iso-west-1",
- },
- Deprecated: boxedTrue,
- },
- endpointKey{
- Region: "rds.us-iso-west-1",
- Variant: fipsVariant,
- }: endpoint{
- Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov",
+ Hostname: "rds.us-iso-west-1.c2s.ic.gov",
CredentialScope: credentialScope{
Region: "us-iso-west-1",
},
@@ -45866,12 +45945,12 @@ var awsisoPartition = partition{
Region: "us-iso-east-1",
Variant: fipsVariant,
}: endpoint{
- Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov",
+ Hostname: "rds.us-iso-east-1.c2s.ic.gov",
},
endpointKey{
Region: "us-iso-east-1-fips",
}: endpoint{
- Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov",
+ Hostname: "rds.us-iso-east-1.c2s.ic.gov",
CredentialScope: credentialScope{
Region: "us-iso-east-1",
},
@@ -45884,12 +45963,12 @@ var awsisoPartition = partition{
Region: "us-iso-west-1",
Variant: fipsVariant,
}: endpoint{
- Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov",
+ Hostname: "rds.us-iso-west-1.c2s.ic.gov",
},
endpointKey{
Region: "us-iso-west-1-fips",
}: endpoint{
- Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov",
+ Hostname: "rds.us-iso-west-1.c2s.ic.gov",
CredentialScope: credentialScope{
Region: "us-iso-west-1",
},
@@ -46848,24 +46927,9 @@ var awsisobPartition = partition{
},
"ram": service{
Endpoints: serviceEndpoints{
- endpointKey{
- Region: "fips-us-isob-east-1",
- }: endpoint{
- Hostname: "ram-fips.us-isob-east-1.sc2s.sgov.gov",
- CredentialScope: credentialScope{
- Region: "us-isob-east-1",
- },
- Deprecated: boxedTrue,
- },
endpointKey{
Region: "us-isob-east-1",
}: endpoint{},
- endpointKey{
- Region: "us-isob-east-1",
- Variant: fipsVariant,
- }: endpoint{
- Hostname: "ram-fips.us-isob-east-1.sc2s.sgov.gov",
- },
},
},
"rbin": service{
@@ -46892,28 +46956,10 @@ var awsisobPartition = partition{
},
"rds": service{
Endpoints: serviceEndpoints{
- endpointKey{
- Region: "rds-fips.us-isob-east-1",
- }: endpoint{
- Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov",
- CredentialScope: credentialScope{
- Region: "us-isob-east-1",
- },
- Deprecated: boxedTrue,
- },
endpointKey{
Region: "rds.us-isob-east-1",
}: endpoint{
- CredentialScope: credentialScope{
- Region: "us-isob-east-1",
- },
- Deprecated: boxedTrue,
- },
- endpointKey{
- Region: "rds.us-isob-east-1",
- Variant: fipsVariant,
- }: endpoint{
- Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov",
+ Hostname: "rds.us-isob-east-1.sc2s.sgov.gov",
CredentialScope: credentialScope{
Region: "us-isob-east-1",
},
@@ -46926,12 +46972,12 @@ var awsisobPartition = partition{
Region: "us-isob-east-1",
Variant: fipsVariant,
}: endpoint{
- Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov",
+ Hostname: "rds.us-isob-east-1.sc2s.sgov.gov",
},
endpointKey{
Region: "us-isob-east-1-fips",
}: endpoint{
- Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov",
+ Hostname: "rds.us-isob-east-1.sc2s.sgov.gov",
CredentialScope: credentialScope{
Region: "us-isob-east-1",
},
@@ -47286,7 +47332,11 @@ var awsisoePartition = partition{
SignatureVersions: []string{"v4"},
},
},
- Regions: regions{},
+ Regions: regions{
+ "eu-isoe-west-1": region{
+ Description: "EU ISOE West",
+ },
+ },
Services: services{},
}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/version.go b/vendor/github.com/aws/aws-sdk-go/aws/version.go
index 1408863f2..dcaa20d28 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/version.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/version.go
@@ -5,4 +5,4 @@ package aws
const SDKName = "aws-sdk-go"
// SDKVersion is the version of this SDK
-const SDKVersion = "1.53.8"
+const SDKVersion = "1.53.18"
diff --git a/vendor/github.com/hashicorp/go-version/CHANGELOG.md b/vendor/github.com/hashicorp/go-version/CHANGELOG.md
index 5f16dd140..6d48174bf 100644
--- a/vendor/github.com/hashicorp/go-version/CHANGELOG.md
+++ b/vendor/github.com/hashicorp/go-version/CHANGELOG.md
@@ -1,3 +1,22 @@
+# 1.7.0 (May 24, 2024)
+
+ENHANCEMENTS:
+
+- Remove `reflect` dependency ([#91](https://github.com/hashicorp/go-version/pull/91))
+- Implement the `database/sql.Scanner` and `database/sql/driver.Value` interfaces for `Version` ([#133](https://github.com/hashicorp/go-version/pull/133))
+
+INTERNAL:
+
+- [COMPLIANCE] Add Copyright and License Headers ([#115](https://github.com/hashicorp/go-version/pull/115))
+- [COMPLIANCE] Update MPL-2.0 LICENSE ([#105](https://github.com/hashicorp/go-version/pull/105))
+- Bump actions/cache from 3.0.11 to 3.2.5 ([#116](https://github.com/hashicorp/go-version/pull/116))
+- Bump actions/checkout from 3.2.0 to 3.3.0 ([#111](https://github.com/hashicorp/go-version/pull/111))
+- Bump actions/upload-artifact from 3.1.1 to 3.1.2 ([#112](https://github.com/hashicorp/go-version/pull/112))
+- GHA Migration ([#103](https://github.com/hashicorp/go-version/pull/103))
+- github: Pin external GitHub Actions to hashes ([#107](https://github.com/hashicorp/go-version/pull/107))
+- SEC-090: Automated trusted workflow pinning (2023-04-05) ([#124](https://github.com/hashicorp/go-version/pull/124))
+- update readme ([#104](https://github.com/hashicorp/go-version/pull/104))
+
# 1.6.0 (June 28, 2022)
FEATURES:
diff --git a/vendor/github.com/hashicorp/go-version/LICENSE b/vendor/github.com/hashicorp/go-version/LICENSE
index c33dcc7c9..1409d6ab9 100644
--- a/vendor/github.com/hashicorp/go-version/LICENSE
+++ b/vendor/github.com/hashicorp/go-version/LICENSE
@@ -1,3 +1,5 @@
+Copyright (c) 2014 HashiCorp, Inc.
+
Mozilla Public License, version 2.0
1. Definitions
diff --git a/vendor/github.com/hashicorp/go-version/README.md b/vendor/github.com/hashicorp/go-version/README.md
index 4d2505090..4b7806cd9 100644
--- a/vendor/github.com/hashicorp/go-version/README.md
+++ b/vendor/github.com/hashicorp/go-version/README.md
@@ -1,5 +1,5 @@
# Versioning Library for Go
-[![Build Status](https://circleci.com/gh/hashicorp/go-version/tree/main.svg?style=svg)](https://circleci.com/gh/hashicorp/go-version/tree/main)
+![Build Status](https://github.com/hashicorp/go-version/actions/workflows/go-tests.yml/badge.svg)
[![GoDoc](https://godoc.org/github.com/hashicorp/go-version?status.svg)](https://godoc.org/github.com/hashicorp/go-version)
go-version is a library for parsing versions and version constraints,
diff --git a/vendor/github.com/hashicorp/go-version/constraint.go b/vendor/github.com/hashicorp/go-version/constraint.go
index da5d1aca1..29bdc4d2b 100644
--- a/vendor/github.com/hashicorp/go-version/constraint.go
+++ b/vendor/github.com/hashicorp/go-version/constraint.go
@@ -1,8 +1,10 @@
+// Copyright (c) HashiCorp, Inc.
+// SPDX-License-Identifier: MPL-2.0
+
package version
import (
"fmt"
- "reflect"
"regexp"
"sort"
"strings"
@@ -199,7 +201,7 @@ func prereleaseCheck(v, c *Version) bool {
case cPre && vPre:
// A constraint with a pre-release can only match a pre-release version
// with the same base segments.
- return reflect.DeepEqual(c.Segments64(), v.Segments64())
+ return v.equalSegments(c)
case !cPre && vPre:
// A constraint without a pre-release can only match a version without a
diff --git a/vendor/github.com/hashicorp/go-version/version.go b/vendor/github.com/hashicorp/go-version/version.go
index e87df6990..7c683c281 100644
--- a/vendor/github.com/hashicorp/go-version/version.go
+++ b/vendor/github.com/hashicorp/go-version/version.go
@@ -1,9 +1,12 @@
+// Copyright (c) HashiCorp, Inc.
+// SPDX-License-Identifier: MPL-2.0
+
package version
import (
"bytes"
+ "database/sql/driver"
"fmt"
- "reflect"
"regexp"
"strconv"
"strings"
@@ -117,11 +120,8 @@ func (v *Version) Compare(other *Version) int {
return 0
}
- segmentsSelf := v.Segments64()
- segmentsOther := other.Segments64()
-
// If the segments are the same, we must compare on prerelease info
- if reflect.DeepEqual(segmentsSelf, segmentsOther) {
+ if v.equalSegments(other) {
preSelf := v.Prerelease()
preOther := other.Prerelease()
if preSelf == "" && preOther == "" {
@@ -137,6 +137,8 @@ func (v *Version) Compare(other *Version) int {
return comparePrereleases(preSelf, preOther)
}
+ segmentsSelf := v.Segments64()
+ segmentsOther := other.Segments64()
// Get the highest specificity (hS), or if they're equal, just use segmentSelf length
lenSelf := len(segmentsSelf)
lenOther := len(segmentsOther)
@@ -160,7 +162,7 @@ func (v *Version) Compare(other *Version) int {
// this means Other had the lower specificity
// Check to see if the remaining segments in Self are all zeros -
if !allZero(segmentsSelf[i:]) {
- //if not, it means that Self has to be greater than Other
+ // if not, it means that Self has to be greater than Other
return 1
}
break
@@ -180,6 +182,21 @@ func (v *Version) Compare(other *Version) int {
return 0
}
+func (v *Version) equalSegments(other *Version) bool {
+ segmentsSelf := v.Segments64()
+ segmentsOther := other.Segments64()
+
+ if len(segmentsSelf) != len(segmentsOther) {
+ return false
+ }
+ for i, v := range segmentsSelf {
+ if v != segmentsOther[i] {
+ return false
+ }
+ }
+ return true
+}
+
func allZero(segs []int64) bool {
for _, s := range segs {
if s != 0 {
@@ -405,3 +422,20 @@ func (v *Version) UnmarshalText(b []byte) error {
func (v *Version) MarshalText() ([]byte, error) {
return []byte(v.String()), nil
}
+
+// Scan implements the sql.Scanner interface.
+func (v *Version) Scan(src interface{}) error {
+ switch src := src.(type) {
+ case string:
+ return v.UnmarshalText([]byte(src))
+ case nil:
+ return nil
+ default:
+ return fmt.Errorf("cannot scan %T as Version", src)
+ }
+}
+
+// Value implements the driver.Valuer interface.
+func (v *Version) Value() (driver.Value, error) {
+ return v.String(), nil
+}
diff --git a/vendor/github.com/hashicorp/go-version/version_collection.go b/vendor/github.com/hashicorp/go-version/version_collection.go
index cc888d43e..83547fe13 100644
--- a/vendor/github.com/hashicorp/go-version/version_collection.go
+++ b/vendor/github.com/hashicorp/go-version/version_collection.go
@@ -1,3 +1,6 @@
+// Copyright (c) HashiCorp, Inc.
+// SPDX-License-Identifier: MPL-2.0
+
package version
// Collection is a type that implements the sort.Interface interface
diff --git a/vendor/github.com/prometheus/common/config/config.go b/vendor/github.com/prometheus/common/config/config.go
index 3da4854d0..7588da555 100644
--- a/vendor/github.com/prometheus/common/config/config.go
+++ b/vendor/github.com/prometheus/common/config/config.go
@@ -60,9 +60,9 @@ func (s Secret) MarshalJSON() ([]byte, error) {
return json.Marshal(secretToken)
}
-type Header map[string][]Secret
+type ProxyHeader map[string][]Secret
-func (h *Header) HTTPHeader() http.Header {
+func (h *ProxyHeader) HTTPHeader() http.Header {
if h == nil || *h == nil {
return nil
}
diff --git a/vendor/github.com/prometheus/common/config/headers.go b/vendor/github.com/prometheus/common/config/headers.go
new file mode 100644
index 000000000..7c3149eb3
--- /dev/null
+++ b/vendor/github.com/prometheus/common/config/headers.go
@@ -0,0 +1,134 @@
+// Copyright 2024 The Prometheus Authors
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// This package no longer handles safe yaml parsing. In order to
+// ensure correct yaml unmarshalling, use "yaml.UnmarshalStrict()".
+
+package config
+
+import (
+ "fmt"
+ "net/http"
+ "os"
+ "strings"
+)
+
+// reservedHeaders that change the connection, are set by Prometheus, or can
+// be changed otherwise.
+var reservedHeaders = map[string]struct{}{
+ "Authorization": {},
+ "Host": {},
+ "Content-Encoding": {},
+ "Content-Length": {},
+ "Content-Type": {},
+ "User-Agent": {},
+ "Connection": {},
+ "Keep-Alive": {},
+ "Proxy-Authenticate": {},
+ "Proxy-Authorization": {},
+ "Www-Authenticate": {},
+ "Accept-Encoding": {},
+ "X-Prometheus-Remote-Write-Version": {},
+ "X-Prometheus-Remote-Read-Version": {},
+ "X-Prometheus-Scrape-Timeout-Seconds": {},
+
+ // Added by SigV4.
+ "X-Amz-Date": {},
+ "X-Amz-Security-Token": {},
+ "X-Amz-Content-Sha256": {},
+}
+
+// Headers represents the configuration for HTTP headers.
+type Headers struct {
+ Headers map[string]Header `yaml:",inline" json:",inline"`
+ dir string
+}
+
+// Headers represents the configuration for HTTP headers.
+type Header struct {
+ Values []string `yaml:"values,omitempty" json:"values,omitempty"`
+ Secrets []Secret `yaml:"secrets,omitempty" json:"secrets,omitempty"`
+ Files []string `yaml:"files,omitempty" json:"files,omitempty"`
+}
+
+// SetDirectory records the directory to make headers file relative to the
+// configuration file.
+func (h *Headers) SetDirectory(dir string) {
+ if h == nil {
+ return
+ }
+ h.dir = dir
+}
+
+// Validate validates the Headers config.
+func (h *Headers) Validate() error {
+ for n, header := range h.Headers {
+ if _, ok := reservedHeaders[http.CanonicalHeaderKey(n)]; ok {
+ return fmt.Errorf("setting header %q is not allowed", http.CanonicalHeaderKey(n))
+ }
+ for _, v := range header.Files {
+ f := JoinDir(h.dir, v)
+ _, err := os.ReadFile(f)
+ if err != nil {
+ return fmt.Errorf("unable to read header %q from file %s: %w", http.CanonicalHeaderKey(n), f, err)
+ }
+ }
+ }
+ return nil
+}
+
+// NewHeadersRoundTripper returns a RoundTripper that sets HTTP headers on
+// requests as configured.
+func NewHeadersRoundTripper(config *Headers, next http.RoundTripper) http.RoundTripper {
+ if len(config.Headers) == 0 {
+ return next
+ }
+ return &headersRoundTripper{
+ config: config,
+ next: next,
+ }
+}
+
+type headersRoundTripper struct {
+ next http.RoundTripper
+ config *Headers
+}
+
+// RoundTrip implements http.RoundTripper.
+func (rt *headersRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
+ req = cloneRequest(req)
+ for n, h := range rt.config.Headers {
+ for _, v := range h.Values {
+ req.Header.Add(n, v)
+ }
+ for _, v := range h.Secrets {
+ req.Header.Add(n, string(v))
+ }
+ for _, v := range h.Files {
+ f := JoinDir(rt.config.dir, v)
+ b, err := os.ReadFile(f)
+ if err != nil {
+ return nil, fmt.Errorf("unable to read headers file %s: %w", f, err)
+ }
+ req.Header.Add(n, strings.TrimSpace(string(b)))
+ }
+ }
+ return rt.next.RoundTrip(req)
+}
+
+// CloseIdleConnections implements closeIdler.
+func (rt *headersRoundTripper) CloseIdleConnections() {
+ if ci, ok := rt.next.(closeIdler); ok {
+ ci.CloseIdleConnections()
+ }
+}
diff --git a/vendor/github.com/prometheus/common/config/http_config.go b/vendor/github.com/prometheus/common/config/http_config.go
index 204418184..75e38bb8e 100644
--- a/vendor/github.com/prometheus/common/config/http_config.go
+++ b/vendor/github.com/prometheus/common/config/http_config.go
@@ -20,6 +20,7 @@ import (
"crypto/tls"
"crypto/x509"
"encoding/json"
+ "errors"
"fmt"
"net"
"net/http"
@@ -130,8 +131,12 @@ func (tv *TLSVersion) String() string {
type BasicAuth struct {
Username string `yaml:"username" json:"username"`
UsernameFile string `yaml:"username_file,omitempty" json:"username_file,omitempty"`
+ // UsernameRef is the name of the secret within the secret manager to use as the username.
+ UsernameRef string `yaml:"username_ref,omitempty" json:"username_ref,omitempty"`
Password Secret `yaml:"password,omitempty" json:"password,omitempty"`
PasswordFile string `yaml:"password_file,omitempty" json:"password_file,omitempty"`
+ // PasswordRef is the name of the secret within the secret manager to use as the password.
+ PasswordRef string `yaml:"password_ref,omitempty" json:"password_ref,omitempty"`
}
// SetDirectory joins any relative file paths with dir.
@@ -148,6 +153,8 @@ type Authorization struct {
Type string `yaml:"type,omitempty" json:"type,omitempty"`
Credentials Secret `yaml:"credentials,omitempty" json:"credentials,omitempty"`
CredentialsFile string `yaml:"credentials_file,omitempty" json:"credentials_file,omitempty"`
+ // CredentialsRef is the name of the secret within the secret manager to use as credentials.
+ CredentialsRef string `yaml:"credentials_ref,omitempty" json:"credentials_ref,omitempty"`
}
// SetDirectory joins any relative file paths with dir.
@@ -224,14 +231,17 @@ func (u URL) MarshalJSON() ([]byte, error) {
// OAuth2 is the oauth2 client configuration.
type OAuth2 struct {
- ClientID string `yaml:"client_id" json:"client_id"`
- ClientSecret Secret `yaml:"client_secret" json:"client_secret"`
- ClientSecretFile string `yaml:"client_secret_file" json:"client_secret_file"`
- Scopes []string `yaml:"scopes,omitempty" json:"scopes,omitempty"`
- TokenURL string `yaml:"token_url" json:"token_url"`
- EndpointParams map[string]string `yaml:"endpoint_params,omitempty" json:"endpoint_params,omitempty"`
- TLSConfig TLSConfig `yaml:"tls_config,omitempty"`
- ProxyConfig `yaml:",inline"`
+ ClientID string `yaml:"client_id" json:"client_id"`
+ ClientSecret Secret `yaml:"client_secret" json:"client_secret"`
+ ClientSecretFile string `yaml:"client_secret_file" json:"client_secret_file"`
+ // ClientSecretRef is the name of the secret within the secret manager to use as the client
+ // secret.
+ ClientSecretRef string `yaml:"client_secret_ref" json:"client_secret_ref"`
+ Scopes []string `yaml:"scopes,omitempty" json:"scopes,omitempty"`
+ TokenURL string `yaml:"token_url" json:"token_url"`
+ EndpointParams map[string]string `yaml:"endpoint_params,omitempty" json:"endpoint_params,omitempty"`
+ TLSConfig TLSConfig `yaml:"tls_config,omitempty"`
+ ProxyConfig `yaml:",inline"`
}
// UnmarshalYAML implements the yaml.Unmarshaler interface
@@ -253,12 +263,12 @@ func (o *OAuth2) UnmarshalJSON(data []byte) error {
}
// SetDirectory joins any relative file paths with dir.
-func (a *OAuth2) SetDirectory(dir string) {
- if a == nil {
+func (o *OAuth2) SetDirectory(dir string) {
+ if o == nil {
return
}
- a.ClientSecretFile = JoinDir(dir, a.ClientSecretFile)
- a.TLSConfig.SetDirectory(dir)
+ o.ClientSecretFile = JoinDir(dir, o.ClientSecretFile)
+ o.TLSConfig.SetDirectory(dir)
}
// LoadHTTPConfig parses the YAML input s into a HTTPClientConfig.
@@ -311,6 +321,9 @@ type HTTPClientConfig struct {
EnableHTTP2 bool `yaml:"enable_http2" json:"enable_http2"`
// Proxy configuration.
ProxyConfig `yaml:",inline"`
+ // HTTPHeaders specify headers to inject in the requests. Those headers
+ // could be marshalled back to the users.
+ HTTPHeaders *Headers `yaml:"http_headers" json:"http_headers"`
}
// SetDirectory joins any relative file paths with dir.
@@ -322,9 +335,22 @@ func (c *HTTPClientConfig) SetDirectory(dir string) {
c.BasicAuth.SetDirectory(dir)
c.Authorization.SetDirectory(dir)
c.OAuth2.SetDirectory(dir)
+ c.HTTPHeaders.SetDirectory(dir)
c.BearerTokenFile = JoinDir(dir, c.BearerTokenFile)
}
+// nonZeroCount returns the amount of values that are non-zero.
+func nonZeroCount[T comparable](values ...T) int {
+ count := 0
+ var zero T
+ for _, value := range values {
+ if value != zero {
+ count += 1
+ }
+ }
+ return count
+}
+
// Validate validates the HTTPClientConfig to check only one of BearerToken,
// BasicAuth and BearerTokenFile is configured. It also validates that ProxyURL
// is set if ProxyConnectHeader is set.
@@ -336,17 +362,17 @@ func (c *HTTPClientConfig) Validate() error {
if (c.BasicAuth != nil || c.OAuth2 != nil) && (len(c.BearerToken) > 0 || len(c.BearerTokenFile) > 0) {
return fmt.Errorf("at most one of basic_auth, oauth2, bearer_token & bearer_token_file must be configured")
}
- if c.BasicAuth != nil && (string(c.BasicAuth.Username) != "" && c.BasicAuth.UsernameFile != "") {
- return fmt.Errorf("at most one of basic_auth username & username_file must be configured")
+ if c.BasicAuth != nil && nonZeroCount(string(c.BasicAuth.Username) != "", c.BasicAuth.UsernameFile != "", c.BasicAuth.UsernameRef != "") > 1 {
+ return fmt.Errorf("at most one of basic_auth username, username_file & username_ref must be configured")
}
- if c.BasicAuth != nil && (string(c.BasicAuth.Password) != "" && c.BasicAuth.PasswordFile != "") {
- return fmt.Errorf("at most one of basic_auth password & password_file must be configured")
+ if c.BasicAuth != nil && nonZeroCount(string(c.BasicAuth.Password) != "", c.BasicAuth.PasswordFile != "", c.BasicAuth.PasswordRef != "") > 1 {
+ return fmt.Errorf("at most one of basic_auth password, password_file & password_ref must be configured")
}
if c.Authorization != nil {
if len(c.BearerToken) > 0 || len(c.BearerTokenFile) > 0 {
return fmt.Errorf("authorization is not compatible with bearer_token & bearer_token_file")
}
- if string(c.Authorization.Credentials) != "" && c.Authorization.CredentialsFile != "" {
+ if nonZeroCount(string(c.Authorization.Credentials) != "", c.Authorization.CredentialsFile != "", c.Authorization.CredentialsRef != "") > 1 {
return fmt.Errorf("at most one of authorization credentials & credentials_file must be configured")
}
c.Authorization.Type = strings.TrimSpace(c.Authorization.Type)
@@ -381,13 +407,18 @@ func (c *HTTPClientConfig) Validate() error {
if len(c.OAuth2.TokenURL) == 0 {
return fmt.Errorf("oauth2 token_url must be configured")
}
- if len(c.OAuth2.ClientSecret) > 0 && len(c.OAuth2.ClientSecretFile) > 0 {
- return fmt.Errorf("at most one of oauth2 client_secret & client_secret_file must be configured")
+ if nonZeroCount(len(c.OAuth2.ClientSecret) > 0, len(c.OAuth2.ClientSecretFile) > 0, len(c.OAuth2.ClientSecretRef) > 0) > 1 {
+ return fmt.Errorf("at most one of oauth2 client_secret, client_secret_file & client_secret_ref must be configured")
}
}
if err := c.ProxyConfig.Validate(); err != nil {
return err
}
+ if c.HTTPHeaders != nil {
+ if err := c.HTTPHeaders.Validate(); err != nil {
+ return err
+ }
+ }
return nil
}
@@ -428,50 +459,78 @@ type httpClientOptions struct {
idleConnTimeout time.Duration
userAgent string
host string
+ secretManager SecretManager
}
// HTTPClientOption defines an option that can be applied to the HTTP client.
-type HTTPClientOption func(options *httpClientOptions)
+type HTTPClientOption interface {
+ applyToHTTPClientOptions(options *httpClientOptions)
+}
+
+type httpClientOptionFunc func(options *httpClientOptions)
+
+func (f httpClientOptionFunc) applyToHTTPClientOptions(options *httpClientOptions) {
+ f(options)
+}
// WithDialContextFunc allows you to override func gets used for the actual dialing. The default is `net.Dialer.DialContext`.
func WithDialContextFunc(fn DialContextFunc) HTTPClientOption {
- return func(opts *httpClientOptions) {
+ return httpClientOptionFunc(func(opts *httpClientOptions) {
opts.dialContextFunc = fn
- }
+ })
}
// WithKeepAlivesDisabled allows to disable HTTP keepalive.
func WithKeepAlivesDisabled() HTTPClientOption {
- return func(opts *httpClientOptions) {
+ return httpClientOptionFunc(func(opts *httpClientOptions) {
opts.keepAlivesEnabled = false
- }
+ })
}
// WithHTTP2Disabled allows to disable HTTP2.
func WithHTTP2Disabled() HTTPClientOption {
- return func(opts *httpClientOptions) {
+ return httpClientOptionFunc(func(opts *httpClientOptions) {
opts.http2Enabled = false
- }
+ })
}
// WithIdleConnTimeout allows setting the idle connection timeout.
func WithIdleConnTimeout(timeout time.Duration) HTTPClientOption {
- return func(opts *httpClientOptions) {
+ return httpClientOptionFunc(func(opts *httpClientOptions) {
opts.idleConnTimeout = timeout
- }
+ })
}
// WithUserAgent allows setting the user agent.
func WithUserAgent(ua string) HTTPClientOption {
- return func(opts *httpClientOptions) {
+ return httpClientOptionFunc(func(opts *httpClientOptions) {
opts.userAgent = ua
- }
+ })
}
// WithHost allows setting the host header.
func WithHost(host string) HTTPClientOption {
- return func(opts *httpClientOptions) {
+ return httpClientOptionFunc(func(opts *httpClientOptions) {
opts.host = host
+ })
+}
+
+type secretManagerOption struct {
+ secretManager SecretManager
+}
+
+func (s *secretManagerOption) applyToHTTPClientOptions(opts *httpClientOptions) {
+ opts.secretManager = s.secretManager
+}
+
+func (s *secretManagerOption) applyToTLSConfigOptions(opts *tlsConfigOptions) {
+ opts.secretManager = s.secretManager
+}
+
+// WithSecretManager allows setting the secret manager.
+func WithSecretManager(manager SecretManager) *secretManagerOption {
+ return &secretManagerOption{
+ secretManager: manager,
}
}
@@ -501,9 +560,16 @@ func NewClientFromConfig(cfg HTTPClientConfig, name string, optFuncs ...HTTPClie
// given config.HTTPClientConfig and config.HTTPClientOption.
// The name is used as go-conntrack metric label.
func NewRoundTripperFromConfig(cfg HTTPClientConfig, name string, optFuncs ...HTTPClientOption) (http.RoundTripper, error) {
+ return NewRoundTripperFromConfigWithContext(context.Background(), cfg, name, optFuncs...)
+}
+
+// NewRoundTripperFromConfigWithContext returns a new HTTP RoundTripper configured for the
+// given config.HTTPClientConfig and config.HTTPClientOption.
+// The name is used as go-conntrack metric label.
+func NewRoundTripperFromConfigWithContext(ctx context.Context, cfg HTTPClientConfig, name string, optFuncs ...HTTPClientOption) (http.RoundTripper, error) {
opts := defaultHTTPClientOptions
- for _, f := range optFuncs {
- f(&opts)
+ for _, opt := range optFuncs {
+ opt.applyToHTTPClientOptions(&opts)
}
var dialContext func(ctx context.Context, network, addr string) (net.Conn, error)
@@ -551,25 +617,45 @@ func NewRoundTripperFromConfig(cfg HTTPClientConfig, name string, optFuncs ...HT
// If a authorization_credentials is provided, create a round tripper that will set the
// Authorization header correctly on each request.
- if cfg.Authorization != nil && len(cfg.Authorization.CredentialsFile) > 0 {
- rt = NewAuthorizationCredentialsFileRoundTripper(cfg.Authorization.Type, cfg.Authorization.CredentialsFile, rt)
- } else if cfg.Authorization != nil {
- rt = NewAuthorizationCredentialsRoundTripper(cfg.Authorization.Type, cfg.Authorization.Credentials, rt)
+ if cfg.Authorization != nil {
+ credentialsSecret, err := toSecret(opts.secretManager, cfg.Authorization.Credentials, cfg.Authorization.CredentialsFile, cfg.Authorization.CredentialsRef)
+ if err != nil {
+ return nil, fmt.Errorf("unable to use credentials: %w", err)
+ }
+ rt = NewAuthorizationCredentialsRoundTripper(cfg.Authorization.Type, credentialsSecret, rt)
}
// Backwards compatibility, be nice with importers who would not have
// called Validate().
- if len(cfg.BearerToken) > 0 {
- rt = NewAuthorizationCredentialsRoundTripper("Bearer", cfg.BearerToken, rt)
- } else if len(cfg.BearerTokenFile) > 0 {
- rt = NewAuthorizationCredentialsFileRoundTripper("Bearer", cfg.BearerTokenFile, rt)
+ if len(cfg.BearerToken) > 0 || len(cfg.BearerTokenFile) > 0 {
+ bearerSecret, err := toSecret(opts.secretManager, cfg.BearerToken, cfg.BearerTokenFile, "")
+ if err != nil {
+ return nil, fmt.Errorf("unable to use bearer token: %w", err)
+ }
+ rt = NewAuthorizationCredentialsRoundTripper("Bearer", bearerSecret, rt)
}
if cfg.BasicAuth != nil {
- rt = NewBasicAuthRoundTripper(cfg.BasicAuth.Username, cfg.BasicAuth.Password, cfg.BasicAuth.UsernameFile, cfg.BasicAuth.PasswordFile, rt)
+ usernameSecret, err := toSecret(opts.secretManager, Secret(cfg.BasicAuth.Username), cfg.BasicAuth.UsernameFile, cfg.BasicAuth.UsernameRef)
+ if err != nil {
+ return nil, fmt.Errorf("unable to use username: %w", err)
+ }
+ passwordSecret, err := toSecret(opts.secretManager, cfg.BasicAuth.Password, cfg.BasicAuth.PasswordFile, cfg.BasicAuth.PasswordRef)
+ if err != nil {
+ return nil, fmt.Errorf("unable to use password: %w", err)
+ }
+ rt = NewBasicAuthRoundTripper(usernameSecret, passwordSecret, rt)
}
if cfg.OAuth2 != nil {
- rt = NewOAuth2RoundTripper(cfg.OAuth2, rt, &opts)
+ clientSecret, err := toSecret(opts.secretManager, cfg.OAuth2.ClientSecret, cfg.OAuth2.ClientSecretFile, cfg.OAuth2.ClientSecretRef)
+ if err != nil {
+ return nil, fmt.Errorf("unable to use client secret: %w", err)
+ }
+ rt = NewOAuth2RoundTripper(clientSecret, cfg.OAuth2, rt, &opts)
+ }
+
+ if cfg.HTTPHeaders != nil {
+ rt = NewHeadersRoundTripper(cfg.HTTPHeaders, rt)
}
if opts.userAgent != "" {
@@ -584,35 +670,143 @@ func NewRoundTripperFromConfig(cfg HTTPClientConfig, name string, optFuncs ...HT
return rt, nil
}
- tlsConfig, err := NewTLSConfig(&cfg.TLSConfig)
+ tlsConfig, err := NewTLSConfig(&cfg.TLSConfig, WithSecretManager(opts.secretManager))
if err != nil {
return nil, err
}
- if len(cfg.TLSConfig.CAFile) == 0 {
+ tlsSettings, err := cfg.TLSConfig.roundTripperSettings(opts.secretManager)
+ if err != nil {
+ return nil, err
+ }
+ if tlsSettings.CA == nil || tlsSettings.CA.immutable() {
// No need for a RoundTripper that reloads the CA file automatically.
return newRT(tlsConfig)
}
- return NewTLSRoundTripper(tlsConfig, cfg.TLSConfig.roundTripperSettings(), newRT)
+ return NewTLSRoundTripperWithContext(ctx, tlsConfig, tlsSettings, newRT)
+}
+
+// SecretManager manages secret data mapped to names known as "references" or "refs".
+type SecretManager interface {
+ // Fetch returns the secret data given a secret name indicated by `secretRef`.
+ Fetch(ctx context.Context, secretRef string) (string, error)
+}
+
+type secret interface {
+ fetch(ctx context.Context) (string, error)
+ description() string
+ immutable() bool
+}
+
+type inlineSecret struct {
+ text string
+}
+
+func (s *inlineSecret) fetch(context.Context) (string, error) {
+ return s.text, nil
+}
+
+func (s *inlineSecret) description() string {
+ return "inline"
+}
+
+func (s *inlineSecret) immutable() bool {
+ return true
+}
+
+type fileSecret struct {
+ file string
+}
+
+func (s *fileSecret) fetch(ctx context.Context) (string, error) {
+ fileBytes, err := os.ReadFile(s.file)
+ if err != nil {
+ return "", fmt.Errorf("unable to read file %s: %w", s.file, err)
+ }
+ return strings.TrimSpace(string(fileBytes)), nil
+}
+
+func (s *fileSecret) description() string {
+ return fmt.Sprintf("file %s", s.file)
+}
+
+func (s *fileSecret) immutable() bool {
+ return false
+}
+
+// refSecret fetches a single secret from a secret manager.
+type refSecret struct {
+ ref string
+ manager SecretManager // manager is expected to be not nil.
+}
+
+func (s *refSecret) fetch(ctx context.Context) (string, error) {
+ return s.manager.Fetch(ctx, s.ref)
+}
+
+func (s *refSecret) description() string {
+ return fmt.Sprintf("ref %s", s.ref)
+}
+
+func (s *refSecret) immutable() bool {
+ return false
+}
+
+// toSecret returns a secret from one of the given sources, assuming exactly
+// one or none of the sources are provided.
+func toSecret(secretManager SecretManager, text Secret, file, ref string) (secret, error) {
+ if text != "" {
+ return &inlineSecret{
+ text: string(text),
+ }, nil
+ }
+ if file != "" {
+ return &fileSecret{
+ file: file,
+ }, nil
+ }
+ if ref != "" {
+ if secretManager == nil {
+ return nil, errors.New("cannot use secret ref without manager")
+ }
+ return &refSecret{
+ ref: ref,
+ manager: secretManager,
+ }, nil
+ }
+ return nil, nil
}
type authorizationCredentialsRoundTripper struct {
authType string
- authCredentials Secret
+ authCredentials secret
rt http.RoundTripper
}
-// NewAuthorizationCredentialsRoundTripper adds the provided credentials to a
-// request unless the authorization header has already been set.
-func NewAuthorizationCredentialsRoundTripper(authType string, authCredentials Secret, rt http.RoundTripper) http.RoundTripper {
+// NewAuthorizationCredentialsRoundTripper adds the authorization credentials
+// read from the provided secret to a request unless the authorization header
+// has already been set.
+func NewAuthorizationCredentialsRoundTripper(authType string, authCredentials secret, rt http.RoundTripper) http.RoundTripper {
return &authorizationCredentialsRoundTripper{authType, authCredentials, rt}
}
func (rt *authorizationCredentialsRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
- if len(req.Header.Get("Authorization")) == 0 {
- req = cloneRequest(req)
- req.Header.Set("Authorization", fmt.Sprintf("%s %s", rt.authType, string(rt.authCredentials)))
+ if len(req.Header.Get("Authorization")) != 0 {
+ return rt.rt.RoundTrip(req)
}
+
+ var authCredentials string
+ if rt.authCredentials != nil {
+ var err error
+ authCredentials, err = rt.authCredentials.fetch(req.Context())
+ if err != nil {
+ return nil, fmt.Errorf("unable to read authorization credentials: %w", err)
+ }
+ }
+
+ req = cloneRequest(req)
+ req.Header.Set("Authorization", fmt.Sprintf("%s %s", rt.authType, authCredentials))
+
return rt.rt.RoundTrip(req)
}
@@ -622,77 +816,37 @@ func (rt *authorizationCredentialsRoundTripper) CloseIdleConnections() {
}
}
-type authorizationCredentialsFileRoundTripper struct {
- authType string
- authCredentialsFile string
- rt http.RoundTripper
-}
-
-// NewAuthorizationCredentialsFileRoundTripper adds the authorization
-// credentials read from the provided file to a request unless the authorization
-// header has already been set. This file is read for every request.
-func NewAuthorizationCredentialsFileRoundTripper(authType, authCredentialsFile string, rt http.RoundTripper) http.RoundTripper {
- return &authorizationCredentialsFileRoundTripper{authType, authCredentialsFile, rt}
-}
-
-func (rt *authorizationCredentialsFileRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
- if len(req.Header.Get("Authorization")) == 0 {
- b, err := os.ReadFile(rt.authCredentialsFile)
- if err != nil {
- return nil, fmt.Errorf("unable to read authorization credentials file %s: %w", rt.authCredentialsFile, err)
- }
- authCredentials := strings.TrimSpace(string(b))
-
- req = cloneRequest(req)
- req.Header.Set("Authorization", fmt.Sprintf("%s %s", rt.authType, authCredentials))
- }
-
- return rt.rt.RoundTrip(req)
-}
-
-func (rt *authorizationCredentialsFileRoundTripper) CloseIdleConnections() {
- if ci, ok := rt.rt.(closeIdler); ok {
- ci.CloseIdleConnections()
- }
-}
-
type basicAuthRoundTripper struct {
- username string
- password Secret
- usernameFile string
- passwordFile string
- rt http.RoundTripper
+ username secret
+ password secret
+ rt http.RoundTripper
}
// NewBasicAuthRoundTripper will apply a BASIC auth authorization header to a request unless it has
// already been set.
-func NewBasicAuthRoundTripper(username string, password Secret, usernameFile, passwordFile string, rt http.RoundTripper) http.RoundTripper {
- return &basicAuthRoundTripper{username, password, usernameFile, passwordFile, rt}
+func NewBasicAuthRoundTripper(username secret, password secret, rt http.RoundTripper) http.RoundTripper {
+ return &basicAuthRoundTripper{username, password, rt}
}
func (rt *basicAuthRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
- var username string
- var password string
if len(req.Header.Get("Authorization")) != 0 {
return rt.rt.RoundTrip(req)
}
- if rt.usernameFile != "" {
- usernameBytes, err := os.ReadFile(rt.usernameFile)
+ var username string
+ var password string
+ if rt.username != nil {
+ var err error
+ username, err = rt.username.fetch(req.Context())
if err != nil {
- return nil, fmt.Errorf("unable to read basic auth username file %s: %w", rt.usernameFile, err)
+ return nil, fmt.Errorf("unable to read basic auth username: %w", err)
}
- username = strings.TrimSpace(string(usernameBytes))
- } else {
- username = rt.username
}
- if rt.passwordFile != "" {
- passwordBytes, err := os.ReadFile(rt.passwordFile)
+ if rt.password != nil {
+ var err error
+ password, err = rt.password.fetch(req.Context())
if err != nil {
- return nil, fmt.Errorf("unable to read basic auth password file %s: %w", rt.passwordFile, err)
+ return nil, fmt.Errorf("unable to read basic auth password: %w", err)
}
- password = strings.TrimSpace(string(passwordBytes))
- } else {
- password = string(rt.password)
}
req = cloneRequest(req)
req.SetBasicAuth(username, password)
@@ -706,104 +860,118 @@ func (rt *basicAuthRoundTripper) CloseIdleConnections() {
}
type oauth2RoundTripper struct {
- config *OAuth2
- rt http.RoundTripper
- next http.RoundTripper
- secret string
- mtx sync.RWMutex
- opts *httpClientOptions
- client *http.Client
+ mtx sync.RWMutex
+ lastRT *oauth2.Transport
+ lastSecret string
+
+ // Required for interaction with Oauth2 server.
+ config *OAuth2
+ clientSecret secret
+ opts *httpClientOptions
+ client *http.Client
}
-func NewOAuth2RoundTripper(config *OAuth2, next http.RoundTripper, opts *httpClientOptions) http.RoundTripper {
+func NewOAuth2RoundTripper(clientSecret secret, config *OAuth2, next http.RoundTripper, opts *httpClientOptions) http.RoundTripper {
+ if clientSecret == nil {
+ clientSecret = &inlineSecret{text: ""}
+ }
+
return &oauth2RoundTripper{
config: config,
- next: next,
- opts: opts,
+ // A correct tokenSource will be added later on.
+ lastRT: &oauth2.Transport{Base: next},
+ opts: opts,
+ clientSecret: clientSecret,
}
}
+func (rt *oauth2RoundTripper) newOauth2TokenSource(req *http.Request, secret string) (client *http.Client, source oauth2.TokenSource, err error) {
+ tlsConfig, err := NewTLSConfig(&rt.config.TLSConfig, WithSecretManager(rt.opts.secretManager))
+ if err != nil {
+ return nil, nil, err
+ }
+
+ tlsTransport := func(tlsConfig *tls.Config) (http.RoundTripper, error) {
+ return &http.Transport{
+ TLSClientConfig: tlsConfig,
+ Proxy: rt.config.ProxyConfig.Proxy(),
+ ProxyConnectHeader: rt.config.ProxyConfig.GetProxyConnectHeader(),
+ DisableKeepAlives: !rt.opts.keepAlivesEnabled,
+ MaxIdleConns: 20,
+ MaxIdleConnsPerHost: 1, // see https://github.com/golang/go/issues/13801
+ IdleConnTimeout: 10 * time.Second,
+ TLSHandshakeTimeout: 10 * time.Second,
+ ExpectContinueTimeout: 1 * time.Second,
+ }, nil
+ }
+
+ var t http.RoundTripper
+ tlsSettings, err := rt.config.TLSConfig.roundTripperSettings(rt.opts.secretManager)
+ if err != nil {
+ return nil, nil, err
+ }
+ if tlsSettings.CA == nil || tlsSettings.CA.immutable() {
+ t, _ = tlsTransport(tlsConfig)
+ } else {
+ t, err = NewTLSRoundTripperWithContext(req.Context(), tlsConfig, tlsSettings, tlsTransport)
+ if err != nil {
+ return nil, nil, err
+ }
+ }
+
+ if ua := req.UserAgent(); ua != "" {
+ t = NewUserAgentRoundTripper(ua, t)
+ }
+
+ config := &clientcredentials.Config{
+ ClientID: rt.config.ClientID,
+ ClientSecret: secret,
+ Scopes: rt.config.Scopes,
+ TokenURL: rt.config.TokenURL,
+ EndpointParams: mapToValues(rt.config.EndpointParams),
+ }
+ client = &http.Client{Transport: t}
+ ctx := context.WithValue(context.Background(), oauth2.HTTPClient, client)
+ return client, config.TokenSource(ctx), nil
+}
+
func (rt *oauth2RoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
var (
- secret string
- changed bool
+ secret string
+ needsInit bool
)
- if rt.config.ClientSecretFile != "" {
- data, err := os.ReadFile(rt.config.ClientSecretFile)
+ rt.mtx.RLock()
+ secret = rt.lastSecret
+ needsInit = rt.lastRT.Source == nil
+ rt.mtx.RUnlock()
+
+ // Fetch the secret if it's our first run or always if the secret can change.
+ if !rt.clientSecret.immutable() || needsInit {
+ newSecret, err := rt.clientSecret.fetch(req.Context())
if err != nil {
- return nil, fmt.Errorf("unable to read oauth2 client secret file %s: %w", rt.config.ClientSecretFile, err)
+ return nil, fmt.Errorf("unable to read oauth2 client secret: %w", err)
}
- secret = strings.TrimSpace(string(data))
- rt.mtx.RLock()
- changed = secret != rt.secret
- rt.mtx.RUnlock()
- } else {
- // Either an inline secret or nothing (use an empty string) was provided.
- secret = string(rt.config.ClientSecret)
- }
-
- if changed || rt.rt == nil {
- config := &clientcredentials.Config{
- ClientID: rt.config.ClientID,
- ClientSecret: secret,
- Scopes: rt.config.Scopes,
- TokenURL: rt.config.TokenURL,
- EndpointParams: mapToValues(rt.config.EndpointParams),
- }
-
- tlsConfig, err := NewTLSConfig(&rt.config.TLSConfig)
- if err != nil {
- return nil, err
- }
-
- tlsTransport := func(tlsConfig *tls.Config) (http.RoundTripper, error) {
- return &http.Transport{
- TLSClientConfig: tlsConfig,
- Proxy: rt.config.ProxyConfig.Proxy(),
- ProxyConnectHeader: rt.config.ProxyConfig.GetProxyConnectHeader(),
- DisableKeepAlives: !rt.opts.keepAlivesEnabled,
- MaxIdleConns: 20,
- MaxIdleConnsPerHost: 1, // see https://github.com/golang/go/issues/13801
- IdleConnTimeout: 10 * time.Second,
- TLSHandshakeTimeout: 10 * time.Second,
- ExpectContinueTimeout: 1 * time.Second,
- }, nil
- }
-
- var t http.RoundTripper
- if len(rt.config.TLSConfig.CAFile) == 0 {
- t, _ = tlsTransport(tlsConfig)
- } else {
- t, err = NewTLSRoundTripper(tlsConfig, rt.config.TLSConfig.roundTripperSettings(), tlsTransport)
+ if newSecret != secret || needsInit {
+ // Secret changed or it's a first run. Rebuilt oauth2 setup.
+ client, source, err := rt.newOauth2TokenSource(req, newSecret)
if err != nil {
return nil, err
}
- }
- if ua := req.UserAgent(); ua != "" {
- t = NewUserAgentRoundTripper(ua, t)
+ rt.mtx.Lock()
+ rt.lastSecret = secret
+ rt.lastRT.Source = source
+ if rt.client != nil {
+ rt.client.CloseIdleConnections()
+ }
+ rt.client = client
+ rt.mtx.Unlock()
}
-
- client := &http.Client{Transport: t}
- ctx := context.WithValue(context.Background(), oauth2.HTTPClient, client)
- tokenSource := config.TokenSource(ctx)
-
- rt.mtx.Lock()
- rt.secret = secret
- rt.rt = &oauth2.Transport{
- Base: rt.next,
- Source: tokenSource,
- }
- if rt.client != nil {
- rt.client.CloseIdleConnections()
- }
- rt.client = client
- rt.mtx.Unlock()
}
rt.mtx.RLock()
- currentRT := rt.rt
+ currentRT := rt.lastRT
rt.mtx.RUnlock()
return currentRT.RoundTrip(req)
}
@@ -812,7 +980,7 @@ func (rt *oauth2RoundTripper) CloseIdleConnections() {
if rt.client != nil {
rt.client.CloseIdleConnections()
}
- if ci, ok := rt.next.(closeIdler); ok {
+ if ci, ok := rt.lastRT.Base.(closeIdler); ok {
ci.CloseIdleConnections()
}
}
@@ -840,8 +1008,27 @@ func cloneRequest(r *http.Request) *http.Request {
return r2
}
+type tlsConfigOptions struct {
+ secretManager SecretManager
+}
+
+// TLSConfigOption defines an option that can be applied to the HTTP client.
+type TLSConfigOption interface {
+ applyToTLSConfigOptions(options *tlsConfigOptions)
+}
+
// NewTLSConfig creates a new tls.Config from the given TLSConfig.
-func NewTLSConfig(cfg *TLSConfig) (*tls.Config, error) {
+func NewTLSConfig(cfg *TLSConfig, optFuncs ...TLSConfigOption) (*tls.Config, error) {
+ return NewTLSConfigWithContext(context.Background(), cfg, optFuncs...)
+}
+
+// NewTLSConfigWithContext creates a new tls.Config from the given TLSConfig.
+func NewTLSConfigWithContext(ctx context.Context, cfg *TLSConfig, optFuncs ...TLSConfigOption) (*tls.Config, error) {
+ opts := tlsConfigOptions{}
+ for _, opt := range optFuncs {
+ opt.applyToTLSConfigOptions(&opts)
+ }
+
if err := cfg.Validate(); err != nil {
return nil, err
}
@@ -860,17 +1047,17 @@ func NewTLSConfig(cfg *TLSConfig) (*tls.Config, error) {
// If a CA cert is provided then let's read it in so we can validate the
// scrape target's certificate properly.
- if len(cfg.CA) > 0 {
- if !updateRootCA(tlsConfig, []byte(cfg.CA)) {
- return nil, fmt.Errorf("unable to use inline CA cert")
- }
- } else if len(cfg.CAFile) > 0 {
- b, err := readCAFile(cfg.CAFile)
+ caSecret, err := toSecret(opts.secretManager, Secret(cfg.CA), cfg.CAFile, cfg.CARef)
+ if err != nil {
+ return nil, fmt.Errorf("unable to use CA cert: %w", err)
+ }
+ if caSecret != nil {
+ ca, err := caSecret.fetch(ctx)
if err != nil {
- return nil, err
+ return nil, fmt.Errorf("unable to read CA cert: %w", err)
}
- if !updateRootCA(tlsConfig, b) {
- return nil, fmt.Errorf("unable to use specified CA cert %s", cfg.CAFile)
+ if !updateRootCA(tlsConfig, []byte(ca)) {
+ return nil, fmt.Errorf("unable to use specified CA cert %s", caSecret.description())
}
}
@@ -881,10 +1068,16 @@ func NewTLSConfig(cfg *TLSConfig) (*tls.Config, error) {
// If a client cert & key is provided then configure TLS config accordingly.
if cfg.usingClientCert() && cfg.usingClientKey() {
// Verify that client cert and key are valid.
- if _, err := cfg.getClientCertificate(nil); err != nil {
+ if _, err := cfg.getClientCertificate(ctx, opts.secretManager); err != nil {
return nil, err
}
- tlsConfig.GetClientCertificate = cfg.getClientCertificate
+ tlsConfig.GetClientCertificate = func(cri *tls.CertificateRequestInfo) (*tls.Certificate, error) {
+ var ctx context.Context
+ if cri != nil {
+ ctx = cri.Context()
+ }
+ return cfg.getClientCertificate(ctx, opts.secretManager)
+ }
}
return tlsConfig, nil
@@ -904,6 +1097,15 @@ type TLSConfig struct {
CertFile string `yaml:"cert_file,omitempty" json:"cert_file,omitempty"`
// The client key file for the targets.
KeyFile string `yaml:"key_file,omitempty" json:"key_file,omitempty"`
+ // CARef is the name of the secret within the secret manager to use as the CA cert for the
+ // targets.
+ CARef string `yaml:"ca_ref,omitempty" json:"ca_ref,omitempty"`
+ // CertRef is the name of the secret within the secret manager to use as the client cert for
+ // the targets.
+ CertRef string `yaml:"cert_ref,omitempty" json:"cert_ref,omitempty"`
+ // KeyRef is the name of the secret within the secret manager to use as the client key for
+ // the targets.
+ KeyRef string `yaml:"key_ref,omitempty" json:"key_ref,omitempty"`
// Used to verify the hostname for the targets.
ServerName string `yaml:"server_name,omitempty" json:"server_name,omitempty"`
// Disable target certificate validation.
@@ -937,13 +1139,13 @@ func (c *TLSConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
// file-based fields for the TLS CA, client certificate, and client key are
// used.
func (c *TLSConfig) Validate() error {
- if len(c.CA) > 0 && len(c.CAFile) > 0 {
- return fmt.Errorf("at most one of ca and ca_file must be configured")
+ if nonZeroCount(len(c.CA) > 0, len(c.CAFile) > 0, len(c.CARef) > 0) > 1 {
+ return fmt.Errorf("at most one of ca, ca_file & ca_ref must be configured")
}
- if len(c.Cert) > 0 && len(c.CertFile) > 0 {
- return fmt.Errorf("at most one of cert and cert_file must be configured")
+ if nonZeroCount(len(c.Cert) > 0, len(c.CertFile) > 0, len(c.CertRef) > 0) > 1 {
+ return fmt.Errorf("at most one of cert, cert_file & cert_ref must be configured")
}
- if len(c.Key) > 0 && len(c.KeyFile) > 0 {
+ if nonZeroCount(len(c.Key) > 0, len(c.KeyFile) > 0, len(c.KeyRef) > 0) > 1 {
return fmt.Errorf("at most one of key and key_file must be configured")
}
@@ -957,66 +1159,70 @@ func (c *TLSConfig) Validate() error {
}
func (c *TLSConfig) usingClientCert() bool {
- return len(c.Cert) > 0 || len(c.CertFile) > 0
+ return len(c.Cert) > 0 || len(c.CertFile) > 0 || len(c.CertRef) > 0
}
func (c *TLSConfig) usingClientKey() bool {
- return len(c.Key) > 0 || len(c.KeyFile) > 0
+ return len(c.Key) > 0 || len(c.KeyFile) > 0 || len(c.KeyRef) > 0
}
-func (c *TLSConfig) roundTripperSettings() TLSRoundTripperSettings {
- return TLSRoundTripperSettings{
- CA: c.CA,
- CAFile: c.CAFile,
- Cert: c.Cert,
- CertFile: c.CertFile,
- Key: string(c.Key),
- KeyFile: c.KeyFile,
+func (c *TLSConfig) roundTripperSettings(secretManager SecretManager) (TLSRoundTripperSettings, error) {
+ ca, err := toSecret(secretManager, Secret(c.CA), c.CAFile, c.CARef)
+ if err != nil {
+ return TLSRoundTripperSettings{}, err
}
+ cert, err := toSecret(secretManager, Secret(c.Cert), c.CertFile, c.CertRef)
+ if err != nil {
+ return TLSRoundTripperSettings{}, err
+ }
+ key, err := toSecret(secretManager, c.Key, c.KeyFile, c.KeyRef)
+ if err != nil {
+ return TLSRoundTripperSettings{}, err
+ }
+ return TLSRoundTripperSettings{
+ CA: ca,
+ Cert: cert,
+ Key: key,
+ }, nil
}
-// getClientCertificate reads the pair of client cert and key from disk and returns a tls.Certificate.
-func (c *TLSConfig) getClientCertificate(_ *tls.CertificateRequestInfo) (*tls.Certificate, error) {
+// getClientCertificate reads the pair of client cert and key and returns a tls.Certificate.
+func (c *TLSConfig) getClientCertificate(ctx context.Context, secretManager SecretManager) (*tls.Certificate, error) {
var (
- certData, keyData []byte
+ certData, keyData string
err error
)
- if c.CertFile != "" {
- certData, err = os.ReadFile(c.CertFile)
- if err != nil {
- return nil, fmt.Errorf("unable to read specified client cert (%s): %w", c.CertFile, err)
- }
- } else {
- certData = []byte(c.Cert)
- }
-
- if c.KeyFile != "" {
- keyData, err = os.ReadFile(c.KeyFile)
- if err != nil {
- return nil, fmt.Errorf("unable to read specified client key (%s): %w", c.KeyFile, err)
- }
- } else {
- keyData = []byte(c.Key)
- }
-
- cert, err := tls.X509KeyPair(certData, keyData)
+ certSecret, err := toSecret(secretManager, Secret(c.Cert), c.CertFile, c.CertRef)
if err != nil {
- return nil, fmt.Errorf("unable to use specified client cert (%s) & key (%s): %w", c.CertFile, c.KeyFile, err)
+ return nil, fmt.Errorf("unable to use client cert: %w", err)
+ }
+ if certSecret != nil {
+ certData, err = certSecret.fetch(ctx)
+ if err != nil {
+ return nil, fmt.Errorf("unable to read specified client cert: %w", err)
+ }
+ }
+
+ keySecret, err := toSecret(secretManager, Secret(c.Key), c.KeyFile, c.KeyRef)
+ if err != nil {
+ return nil, fmt.Errorf("unable to use client key: %w", err)
+ }
+ if keySecret != nil {
+ keyData, err = keySecret.fetch(ctx)
+ if err != nil {
+ return nil, fmt.Errorf("unable to read specified client key: %w", err)
+ }
+ }
+
+ cert, err := tls.X509KeyPair([]byte(certData), []byte(keyData))
+ if err != nil {
+ return nil, fmt.Errorf("unable to use specified client cert (%s) & key (%s): %w", certSecret.description(), keySecret.description(), err)
}
return &cert, nil
}
-// readCAFile reads the CA cert file from disk.
-func readCAFile(f string) ([]byte, error) {
- data, err := os.ReadFile(f)
- if err != nil {
- return nil, fmt.Errorf("unable to load specified CA cert %s: %w", f, err)
- }
- return data, nil
-}
-
// updateRootCA parses the given byte slice as a series of PEM encoded certificates and updates tls.Config.RootCAs.
func updateRootCA(cfg *tls.Config, b []byte) bool {
caCertPool := x509.NewCertPool()
@@ -1044,15 +1250,24 @@ type tlsRoundTripper struct {
}
type TLSRoundTripperSettings struct {
- CA, CAFile string
- Cert, CertFile string
- Key, KeyFile string
+ CA secret
+ Cert secret
+ Key secret
}
func NewTLSRoundTripper(
cfg *tls.Config,
settings TLSRoundTripperSettings,
newRT func(*tls.Config) (http.RoundTripper, error),
+) (http.RoundTripper, error) {
+ return NewTLSRoundTripperWithContext(context.Background(), cfg, settings, newRT)
+}
+
+func NewTLSRoundTripperWithContext(
+ ctx context.Context,
+ cfg *tls.Config,
+ settings TLSRoundTripperSettings,
+ newRT func(*tls.Config) (http.RoundTripper, error),
) (http.RoundTripper, error) {
t := &tlsRoundTripper{
settings: settings,
@@ -1065,7 +1280,7 @@ func NewTLSRoundTripper(
return nil, err
}
t.rt = rt
- _, t.hashCAData, t.hashCertData, t.hashKeyData, err = t.getTLSDataWithHash()
+ _, t.hashCAData, t.hashCertData, t.hashKeyData, err = t.getTLSDataWithHash(ctx)
if err != nil {
return nil, err
}
@@ -1073,38 +1288,31 @@ func NewTLSRoundTripper(
return t, nil
}
-func (t *tlsRoundTripper) getTLSDataWithHash() ([]byte, []byte, []byte, []byte, error) {
- var (
- caBytes, certBytes, keyBytes []byte
+func (t *tlsRoundTripper) getTLSDataWithHash(ctx context.Context) ([]byte, []byte, []byte, []byte, error) {
+ var caBytes, certBytes, keyBytes []byte
- err error
- )
-
- if t.settings.CAFile != "" {
- caBytes, err = os.ReadFile(t.settings.CAFile)
+ if t.settings.CA != nil {
+ ca, err := t.settings.CA.fetch(ctx)
if err != nil {
- return nil, nil, nil, nil, err
+ return nil, nil, nil, nil, fmt.Errorf("unable to read CA cert: %w", err)
}
- } else if t.settings.CA != "" {
- caBytes = []byte(t.settings.CA)
+ caBytes = []byte(ca)
}
- if t.settings.CertFile != "" {
- certBytes, err = os.ReadFile(t.settings.CertFile)
+ if t.settings.Cert != nil {
+ cert, err := t.settings.Cert.fetch(ctx)
if err != nil {
- return nil, nil, nil, nil, err
+ return nil, nil, nil, nil, fmt.Errorf("unable to read client cert: %w", err)
}
- } else if t.settings.Cert != "" {
- certBytes = []byte(t.settings.Cert)
+ certBytes = []byte(cert)
}
- if t.settings.KeyFile != "" {
- keyBytes, err = os.ReadFile(t.settings.KeyFile)
+ if t.settings.Key != nil {
+ key, err := t.settings.Key.fetch(ctx)
if err != nil {
- return nil, nil, nil, nil, err
+ return nil, nil, nil, nil, fmt.Errorf("unable to read client key: %w", err)
}
- } else if t.settings.Key != "" {
- keyBytes = []byte(t.settings.Key)
+ keyBytes = []byte(key)
}
var caHash, certHash, keyHash [32]byte
@@ -1124,7 +1332,7 @@ func (t *tlsRoundTripper) getTLSDataWithHash() ([]byte, []byte, []byte, []byte,
// RoundTrip implements the http.RoundTrip interface.
func (t *tlsRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
- caData, caHash, certHash, keyHash, err := t.getTLSDataWithHash()
+ caData, caHash, certHash, keyHash, err := t.getTLSDataWithHash(req.Context())
if err != nil {
return nil, err
}
@@ -1145,7 +1353,7 @@ func (t *tlsRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
// using GetClientCertificate.
tlsConfig := t.tlsConfig.Clone()
if !updateRootCA(tlsConfig, caData) {
- return nil, fmt.Errorf("unable to use specified CA cert %s", t.settings.CAFile)
+ return nil, fmt.Errorf("unable to use specified CA cert %s", t.settings.CA.description())
}
rt, err = t.newRT(tlsConfig)
if err != nil {
@@ -1236,7 +1444,7 @@ type ProxyConfig struct {
// proxies during CONNECT requests. Assume that at least _some_ of
// these headers are going to contain secrets and use Secret as the
// value type instead of string.
- ProxyConnectHeader Header `yaml:"proxy_connect_header,omitempty" json:"proxy_connect_header,omitempty"`
+ ProxyConnectHeader ProxyHeader `yaml:"proxy_connect_header,omitempty" json:"proxy_connect_header,omitempty"`
proxyFunc func(*http.Request) (*url.URL, error)
}
diff --git a/vendor/github.com/prometheus/procfs/.golangci.yml b/vendor/github.com/prometheus/procfs/.golangci.yml
index c24864a92..126df9e67 100644
--- a/vendor/github.com/prometheus/procfs/.golangci.yml
+++ b/vendor/github.com/prometheus/procfs/.golangci.yml
@@ -1,9 +1,16 @@
---
linters:
enable:
+ - errcheck
- godot
+ - gosimple
+ - govet
+ - ineffassign
- misspell
- revive
+ - staticcheck
+ - testifylint
+ - unused
linter-settings:
godot:
diff --git a/vendor/github.com/prometheus/procfs/Makefile.common b/vendor/github.com/prometheus/procfs/Makefile.common
index 0e9ace29b..161729235 100644
--- a/vendor/github.com/prometheus/procfs/Makefile.common
+++ b/vendor/github.com/prometheus/procfs/Makefile.common
@@ -61,7 +61,7 @@ PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_
SKIP_GOLANGCI_LINT :=
GOLANGCI_LINT :=
GOLANGCI_LINT_OPTS ?=
-GOLANGCI_LINT_VERSION ?= v1.56.2
+GOLANGCI_LINT_VERSION ?= v1.59.0
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64/arm64.
# windows isn't included here because of the path separator being different.
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))
diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_byteslice.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_byteslice.go
index ea3a3d95c..1f3548b20 100644
--- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_byteslice.go
+++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_byteslice.go
@@ -22,3 +22,13 @@ func GetByteSliceState(ms ByteSlice) *State {
func NewByteSlice(orig *[]byte, state *State) ByteSlice {
return ByteSlice{orig: orig, state: state}
}
+
+func FillTestByteSlice(tv ByteSlice) {
+}
+
+func GenerateTestByteSlice() ByteSlice {
+ state := StateMutable
+ var orig []byte = nil
+
+ return ByteSlice{&orig, &state}
+}
diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_float64slice.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_float64slice.go
index 88d6c33d7..f13349cde 100644
--- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_float64slice.go
+++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_float64slice.go
@@ -22,3 +22,13 @@ func GetFloat64SliceState(ms Float64Slice) *State {
func NewFloat64Slice(orig *[]float64, state *State) Float64Slice {
return Float64Slice{orig: orig, state: state}
}
+
+func FillTestFloat64Slice(tv Float64Slice) {
+}
+
+func GenerateTestFloat64Slice() Float64Slice {
+ state := StateMutable
+ var orig []float64 = nil
+
+ return Float64Slice{&orig, &state}
+}
diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_int64slice.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_int64slice.go
new file mode 100644
index 000000000..cd85707b1
--- /dev/null
+++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_int64slice.go
@@ -0,0 +1,34 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT.
+// To regenerate this file run "make genpdata".
+
+package internal
+
+type Int64Slice struct {
+ orig *[]int64
+ state *State
+}
+
+func GetOrigInt64Slice(ms Int64Slice) *[]int64 {
+ return ms.orig
+}
+
+func GetInt64SliceState(ms Int64Slice) *State {
+ return ms.state
+}
+
+func NewInt64Slice(orig *[]int64, state *State) Int64Slice {
+ return Int64Slice{orig: orig, state: state}
+}
+
+func FillTestInt64Slice(tv Int64Slice) {
+}
+
+func GenerateTestInt64Slice() Int64Slice {
+ state := StateMutable
+ var orig []int64 = nil
+
+ return Int64Slice{&orig, &state}
+}
diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_stringslice.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_stringslice.go
new file mode 100644
index 000000000..508912653
--- /dev/null
+++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_stringslice.go
@@ -0,0 +1,34 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT.
+// To regenerate this file run "make genpdata".
+
+package internal
+
+type StringSlice struct {
+ orig *[]string
+ state *State
+}
+
+func GetOrigStringSlice(ms StringSlice) *[]string {
+ return ms.orig
+}
+
+func GetStringSliceState(ms StringSlice) *State {
+ return ms.state
+}
+
+func NewStringSlice(orig *[]string, state *State) StringSlice {
+ return StringSlice{orig: orig, state: state}
+}
+
+func FillTestStringSlice(tv StringSlice) {
+}
+
+func GenerateTestStringSlice() StringSlice {
+ state := StateMutable
+ var orig []string = nil
+
+ return StringSlice{&orig, &state}
+}
diff --git a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_uint64slice.go b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_uint64slice.go
index fed633ae2..bbb4a4faf 100644
--- a/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_uint64slice.go
+++ b/vendor/go.opentelemetry.io/collector/pdata/internal/generated_wrapper_uint64slice.go
@@ -22,3 +22,13 @@ func GetUInt64SliceState(ms UInt64Slice) *State {
func NewUInt64Slice(orig *[]uint64, state *State) UInt64Slice {
return UInt64Slice{orig: orig, state: state}
}
+
+func FillTestUInt64Slice(tv UInt64Slice) {
+}
+
+func GenerateTestUInt64Slice() UInt64Slice {
+ state := StateMutable
+ var orig []uint64 = nil
+
+ return UInt64Slice{&orig, &state}
+}
diff --git a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_int64slice.go b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_int64slice.go
new file mode 100644
index 000000000..e50cd3cc3
--- /dev/null
+++ b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_int64slice.go
@@ -0,0 +1,108 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT.
+// To regenerate this file run "make genpdata".
+
+package pcommon
+
+import (
+ "go.opentelemetry.io/collector/pdata/internal"
+)
+
+// Int64Slice represents a []int64 slice.
+// The instance of Int64Slice can be assigned to multiple objects since it's immutable.
+//
+// Must use NewInt64Slice function to create new instances.
+// Important: zero-initialized instance is not valid for use.
+type Int64Slice internal.Int64Slice
+
+func (ms Int64Slice) getOrig() *[]int64 {
+ return internal.GetOrigInt64Slice(internal.Int64Slice(ms))
+}
+
+func (ms Int64Slice) getState() *internal.State {
+ return internal.GetInt64SliceState(internal.Int64Slice(ms))
+}
+
+// NewInt64Slice creates a new empty Int64Slice.
+func NewInt64Slice() Int64Slice {
+ orig := []int64(nil)
+ state := internal.StateMutable
+ return Int64Slice(internal.NewInt64Slice(&orig, &state))
+}
+
+// AsRaw returns a copy of the []int64 slice.
+func (ms Int64Slice) AsRaw() []int64 {
+ return copyInt64Slice(nil, *ms.getOrig())
+}
+
+// FromRaw copies raw []int64 into the slice Int64Slice.
+func (ms Int64Slice) FromRaw(val []int64) {
+ ms.getState().AssertMutable()
+ *ms.getOrig() = copyInt64Slice(*ms.getOrig(), val)
+}
+
+// Len returns length of the []int64 slice value.
+// Equivalent of len(int64Slice).
+func (ms Int64Slice) Len() int {
+ return len(*ms.getOrig())
+}
+
+// At returns an item from particular index.
+// Equivalent of int64Slice[i].
+func (ms Int64Slice) At(i int) int64 {
+ return (*ms.getOrig())[i]
+}
+
+// SetAt sets int64 item at particular index.
+// Equivalent of int64Slice[i] = val
+func (ms Int64Slice) SetAt(i int, val int64) {
+ ms.getState().AssertMutable()
+ (*ms.getOrig())[i] = val
+}
+
+// EnsureCapacity ensures Int64Slice has at least the specified capacity.
+// 1. If the newCap <= cap, then is no change in capacity.
+// 2. If the newCap > cap, then the slice capacity will be expanded to the provided value which will be equivalent of:
+// buf := make([]int64, len(int64Slice), newCap)
+// copy(buf, int64Slice)
+// int64Slice = buf
+func (ms Int64Slice) EnsureCapacity(newCap int) {
+ ms.getState().AssertMutable()
+ oldCap := cap(*ms.getOrig())
+ if newCap <= oldCap {
+ return
+ }
+
+ newOrig := make([]int64, len(*ms.getOrig()), newCap)
+ copy(newOrig, *ms.getOrig())
+ *ms.getOrig() = newOrig
+}
+
+// Append appends extra elements to Int64Slice.
+// Equivalent of int64Slice = append(int64Slice, elms...)
+func (ms Int64Slice) Append(elms ...int64) {
+ ms.getState().AssertMutable()
+ *ms.getOrig() = append(*ms.getOrig(), elms...)
+}
+
+// MoveTo moves all elements from the current slice overriding the destination and
+// resetting the current instance to its zero value.
+func (ms Int64Slice) MoveTo(dest Int64Slice) {
+ ms.getState().AssertMutable()
+ dest.getState().AssertMutable()
+ *dest.getOrig() = *ms.getOrig()
+ *ms.getOrig() = nil
+}
+
+// CopyTo copies all elements from the current slice overriding the destination.
+func (ms Int64Slice) CopyTo(dest Int64Slice) {
+ dest.getState().AssertMutable()
+ *dest.getOrig() = copyInt64Slice(*dest.getOrig(), *ms.getOrig())
+}
+
+func copyInt64Slice(dst, src []int64) []int64 {
+ dst = dst[:0]
+ return append(dst, src...)
+}
diff --git a/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_stringslice.go b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_stringslice.go
new file mode 100644
index 000000000..02a75c7a6
--- /dev/null
+++ b/vendor/go.opentelemetry.io/collector/pdata/pcommon/generated_stringslice.go
@@ -0,0 +1,108 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT.
+// To regenerate this file run "make genpdata".
+
+package pcommon
+
+import (
+ "go.opentelemetry.io/collector/pdata/internal"
+)
+
+// StringSlice represents a []string slice.
+// The instance of StringSlice can be assigned to multiple objects since it's immutable.
+//
+// Must use NewStringSlice function to create new instances.
+// Important: zero-initialized instance is not valid for use.
+type StringSlice internal.StringSlice
+
+func (ms StringSlice) getOrig() *[]string {
+ return internal.GetOrigStringSlice(internal.StringSlice(ms))
+}
+
+func (ms StringSlice) getState() *internal.State {
+ return internal.GetStringSliceState(internal.StringSlice(ms))
+}
+
+// NewStringSlice creates a new empty StringSlice.
+func NewStringSlice() StringSlice {
+ orig := []string(nil)
+ state := internal.StateMutable
+ return StringSlice(internal.NewStringSlice(&orig, &state))
+}
+
+// AsRaw returns a copy of the []string slice.
+func (ms StringSlice) AsRaw() []string {
+ return copyStringSlice(nil, *ms.getOrig())
+}
+
+// FromRaw copies raw []string into the slice StringSlice.
+func (ms StringSlice) FromRaw(val []string) {
+ ms.getState().AssertMutable()
+ *ms.getOrig() = copyStringSlice(*ms.getOrig(), val)
+}
+
+// Len returns length of the []string slice value.
+// Equivalent of len(stringSlice).
+func (ms StringSlice) Len() int {
+ return len(*ms.getOrig())
+}
+
+// At returns an item from particular index.
+// Equivalent of stringSlice[i].
+func (ms StringSlice) At(i int) string {
+ return (*ms.getOrig())[i]
+}
+
+// SetAt sets string item at particular index.
+// Equivalent of stringSlice[i] = val
+func (ms StringSlice) SetAt(i int, val string) {
+ ms.getState().AssertMutable()
+ (*ms.getOrig())[i] = val
+}
+
+// EnsureCapacity ensures StringSlice has at least the specified capacity.
+// 1. If the newCap <= cap, then is no change in capacity.
+// 2. If the newCap > cap, then the slice capacity will be expanded to the provided value which will be equivalent of:
+// buf := make([]string, len(stringSlice), newCap)
+// copy(buf, stringSlice)
+// stringSlice = buf
+func (ms StringSlice) EnsureCapacity(newCap int) {
+ ms.getState().AssertMutable()
+ oldCap := cap(*ms.getOrig())
+ if newCap <= oldCap {
+ return
+ }
+
+ newOrig := make([]string, len(*ms.getOrig()), newCap)
+ copy(newOrig, *ms.getOrig())
+ *ms.getOrig() = newOrig
+}
+
+// Append appends extra elements to StringSlice.
+// Equivalent of stringSlice = append(stringSlice, elms...)
+func (ms StringSlice) Append(elms ...string) {
+ ms.getState().AssertMutable()
+ *ms.getOrig() = append(*ms.getOrig(), elms...)
+}
+
+// MoveTo moves all elements from the current slice overriding the destination and
+// resetting the current instance to its zero value.
+func (ms StringSlice) MoveTo(dest StringSlice) {
+ ms.getState().AssertMutable()
+ dest.getState().AssertMutable()
+ *dest.getOrig() = *ms.getOrig()
+ *ms.getOrig() = nil
+}
+
+// CopyTo copies all elements from the current slice overriding the destination.
+func (ms StringSlice) CopyTo(dest StringSlice) {
+ dest.getState().AssertMutable()
+ *dest.getOrig() = copyStringSlice(*dest.getOrig(), *ms.getOrig())
+}
+
+func copyStringSlice(dst, src []string) []string {
+ dst = dst[:0]
+ return append(dst, src...)
+}
diff --git a/vendor/golang.org/x/net/http2/http2.go b/vendor/golang.org/x/net/http2/http2.go
index 6f2df2818..003e649f3 100644
--- a/vendor/golang.org/x/net/http2/http2.go
+++ b/vendor/golang.org/x/net/http2/http2.go
@@ -17,6 +17,7 @@ package http2 // import "golang.org/x/net/http2"
import (
"bufio"
+ "context"
"crypto/tls"
"fmt"
"io"
@@ -26,6 +27,7 @@ import (
"strconv"
"strings"
"sync"
+ "time"
"golang.org/x/net/http/httpguts"
)
@@ -210,12 +212,6 @@ type stringWriter interface {
WriteString(s string) (n int, err error)
}
-// A gate lets two goroutines coordinate their activities.
-type gate chan struct{}
-
-func (g gate) Done() { g <- struct{}{} }
-func (g gate) Wait() { <-g }
-
// A closeWaiter is like a sync.WaitGroup but only goes 1 to 0 (open to closed).
type closeWaiter chan struct{}
@@ -383,3 +379,14 @@ func validPseudoPath(v string) bool {
// makes that struct also non-comparable, and generally doesn't add
// any size (as long as it's first).
type incomparable [0]func()
+
+// synctestGroupInterface is the methods of synctestGroup used by Server and Transport.
+// It's defined as an interface here to let us keep synctestGroup entirely test-only
+// and not a part of non-test builds.
+type synctestGroupInterface interface {
+ Join()
+ Now() time.Time
+ NewTimer(d time.Duration) timer
+ AfterFunc(d time.Duration, f func()) timer
+ ContextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc)
+}
diff --git a/vendor/golang.org/x/net/http2/server.go b/vendor/golang.org/x/net/http2/server.go
index c5d081081..6c349f3ec 100644
--- a/vendor/golang.org/x/net/http2/server.go
+++ b/vendor/golang.org/x/net/http2/server.go
@@ -154,6 +154,39 @@ type Server struct {
// so that we don't embed a Mutex in this struct, which will make the
// struct non-copyable, which might break some callers.
state *serverInternalState
+
+ // Synchronization group used for testing.
+ // Outside of tests, this is nil.
+ group synctestGroupInterface
+}
+
+func (s *Server) markNewGoroutine() {
+ if s.group != nil {
+ s.group.Join()
+ }
+}
+
+func (s *Server) now() time.Time {
+ if s.group != nil {
+ return s.group.Now()
+ }
+ return time.Now()
+}
+
+// newTimer creates a new time.Timer, or a synthetic timer in tests.
+func (s *Server) newTimer(d time.Duration) timer {
+ if s.group != nil {
+ return s.group.NewTimer(d)
+ }
+ return timeTimer{time.NewTimer(d)}
+}
+
+// afterFunc creates a new time.AfterFunc timer, or a synthetic timer in tests.
+func (s *Server) afterFunc(d time.Duration, f func()) timer {
+ if s.group != nil {
+ return s.group.AfterFunc(d, f)
+ }
+ return timeTimer{time.AfterFunc(d, f)}
}
func (s *Server) initialConnRecvWindowSize() int32 {
@@ -400,6 +433,10 @@ func (o *ServeConnOpts) handler() http.Handler {
//
// The opts parameter is optional. If nil, default values are used.
func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) {
+ s.serveConn(c, opts, nil)
+}
+
+func (s *Server) serveConn(c net.Conn, opts *ServeConnOpts, newf func(*serverConn)) {
baseCtx, cancel := serverConnBaseContext(c, opts)
defer cancel()
@@ -426,6 +463,9 @@ func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) {
pushEnabled: true,
sawClientPreface: opts.SawClientPreface,
}
+ if newf != nil {
+ newf(sc)
+ }
s.state.registerConn(sc)
defer s.state.unregisterConn(sc)
@@ -599,8 +639,8 @@ type serverConn struct {
inFrameScheduleLoop bool // whether we're in the scheduleFrameWrite loop
needToSendGoAway bool // we need to schedule a GOAWAY frame write
goAwayCode ErrCode
- shutdownTimer *time.Timer // nil until used
- idleTimer *time.Timer // nil if unused
+ shutdownTimer timer // nil until used
+ idleTimer timer // nil if unused
// Owned by the writeFrameAsync goroutine:
headerWriteBuf bytes.Buffer
@@ -649,12 +689,12 @@ type stream struct {
flow outflow // limits writing from Handler to client
inflow inflow // what the client is allowed to POST/etc to us
state streamState
- resetQueued bool // RST_STREAM queued for write; set by sc.resetStream
- gotTrailerHeader bool // HEADER frame for trailers was seen
- wroteHeaders bool // whether we wrote headers (not status 100)
- readDeadline *time.Timer // nil if unused
- writeDeadline *time.Timer // nil if unused
- closeErr error // set before cw is closed
+ resetQueued bool // RST_STREAM queued for write; set by sc.resetStream
+ gotTrailerHeader bool // HEADER frame for trailers was seen
+ wroteHeaders bool // whether we wrote headers (not status 100)
+ readDeadline timer // nil if unused
+ writeDeadline timer // nil if unused
+ closeErr error // set before cw is closed
trailer http.Header // accumulated trailers
reqTrailer http.Header // handler's Request.Trailer
@@ -811,8 +851,9 @@ type readFrameResult struct {
// consumer is done with the frame.
// It's run on its own goroutine.
func (sc *serverConn) readFrames() {
- gate := make(gate)
- gateDone := gate.Done
+ sc.srv.markNewGoroutine()
+ gate := make(chan struct{})
+ gateDone := func() { gate <- struct{}{} }
for {
f, err := sc.framer.ReadFrame()
select {
@@ -843,6 +884,7 @@ type frameWriteResult struct {
// At most one goroutine can be running writeFrameAsync at a time per
// serverConn.
func (sc *serverConn) writeFrameAsync(wr FrameWriteRequest, wd *writeData) {
+ sc.srv.markNewGoroutine()
var err error
if wd == nil {
err = wr.write.writeFrame(sc)
@@ -922,13 +964,13 @@ func (sc *serverConn) serve() {
sc.setConnState(http.StateIdle)
if sc.srv.IdleTimeout > 0 {
- sc.idleTimer = time.AfterFunc(sc.srv.IdleTimeout, sc.onIdleTimer)
+ sc.idleTimer = sc.srv.afterFunc(sc.srv.IdleTimeout, sc.onIdleTimer)
defer sc.idleTimer.Stop()
}
go sc.readFrames() // closed by defer sc.conn.Close above
- settingsTimer := time.AfterFunc(firstSettingsTimeout, sc.onSettingsTimer)
+ settingsTimer := sc.srv.afterFunc(firstSettingsTimeout, sc.onSettingsTimer)
defer settingsTimer.Stop()
loopNum := 0
@@ -1057,10 +1099,10 @@ func (sc *serverConn) readPreface() error {
errc <- nil
}
}()
- timer := time.NewTimer(prefaceTimeout) // TODO: configurable on *Server?
+ timer := sc.srv.newTimer(prefaceTimeout) // TODO: configurable on *Server?
defer timer.Stop()
select {
- case <-timer.C:
+ case <-timer.C():
return errPrefaceTimeout
case err := <-errc:
if err == nil {
@@ -1425,7 +1467,7 @@ func (sc *serverConn) goAway(code ErrCode) {
func (sc *serverConn) shutDownIn(d time.Duration) {
sc.serveG.check()
- sc.shutdownTimer = time.AfterFunc(d, sc.onShutdownTimer)
+ sc.shutdownTimer = sc.srv.afterFunc(d, sc.onShutdownTimer)
}
func (sc *serverConn) resetStream(se StreamError) {
@@ -1639,7 +1681,7 @@ func (sc *serverConn) closeStream(st *stream, err error) {
delete(sc.streams, st.id)
if len(sc.streams) == 0 {
sc.setConnState(http.StateIdle)
- if sc.srv.IdleTimeout > 0 {
+ if sc.srv.IdleTimeout > 0 && sc.idleTimer != nil {
sc.idleTimer.Reset(sc.srv.IdleTimeout)
}
if h1ServerKeepAlivesDisabled(sc.hs) {
@@ -1661,6 +1703,7 @@ func (sc *serverConn) closeStream(st *stream, err error) {
}
}
st.closeErr = err
+ st.cancelCtx()
st.cw.Close() // signals Handler's CloseNotifier, unblocks writes, etc
sc.writeSched.CloseStream(st.id)
}
@@ -2021,7 +2064,7 @@ func (sc *serverConn) processHeaders(f *MetaHeadersFrame) error {
// (in Go 1.8), though. That's a more sane option anyway.
if sc.hs.ReadTimeout > 0 {
sc.conn.SetReadDeadline(time.Time{})
- st.readDeadline = time.AfterFunc(sc.hs.ReadTimeout, st.onReadTimeout)
+ st.readDeadline = sc.srv.afterFunc(sc.hs.ReadTimeout, st.onReadTimeout)
}
return sc.scheduleHandler(id, rw, req, handler)
@@ -2119,7 +2162,7 @@ func (sc *serverConn) newStream(id, pusherID uint32, state streamState) *stream
st.flow.add(sc.initialStreamSendWindowSize)
st.inflow.init(sc.srv.initialStreamRecvWindowSize())
if sc.hs.WriteTimeout > 0 {
- st.writeDeadline = time.AfterFunc(sc.hs.WriteTimeout, st.onWriteTimeout)
+ st.writeDeadline = sc.srv.afterFunc(sc.hs.WriteTimeout, st.onWriteTimeout)
}
sc.streams[id] = st
@@ -2343,6 +2386,7 @@ func (sc *serverConn) handlerDone() {
// Run on its own goroutine.
func (sc *serverConn) runHandler(rw *responseWriter, req *http.Request, handler func(http.ResponseWriter, *http.Request)) {
+ sc.srv.markNewGoroutine()
defer sc.sendServeMsg(handlerDoneMsg)
didPanic := true
defer func() {
@@ -2639,7 +2683,7 @@ func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) {
var date string
if _, ok := rws.snapHeader["Date"]; !ok {
// TODO(bradfitz): be faster here, like net/http? measure.
- date = time.Now().UTC().Format(http.TimeFormat)
+ date = rws.conn.srv.now().UTC().Format(http.TimeFormat)
}
for _, v := range rws.snapHeader["Trailer"] {
@@ -2761,7 +2805,7 @@ func (rws *responseWriterState) promoteUndeclaredTrailers() {
func (w *responseWriter) SetReadDeadline(deadline time.Time) error {
st := w.rws.stream
- if !deadline.IsZero() && deadline.Before(time.Now()) {
+ if !deadline.IsZero() && deadline.Before(w.rws.conn.srv.now()) {
// If we're setting a deadline in the past, reset the stream immediately
// so writes after SetWriteDeadline returns will fail.
st.onReadTimeout()
@@ -2777,9 +2821,9 @@ func (w *responseWriter) SetReadDeadline(deadline time.Time) error {
if deadline.IsZero() {
st.readDeadline = nil
} else if st.readDeadline == nil {
- st.readDeadline = time.AfterFunc(deadline.Sub(time.Now()), st.onReadTimeout)
+ st.readDeadline = sc.srv.afterFunc(deadline.Sub(sc.srv.now()), st.onReadTimeout)
} else {
- st.readDeadline.Reset(deadline.Sub(time.Now()))
+ st.readDeadline.Reset(deadline.Sub(sc.srv.now()))
}
})
return nil
@@ -2787,7 +2831,7 @@ func (w *responseWriter) SetReadDeadline(deadline time.Time) error {
func (w *responseWriter) SetWriteDeadline(deadline time.Time) error {
st := w.rws.stream
- if !deadline.IsZero() && deadline.Before(time.Now()) {
+ if !deadline.IsZero() && deadline.Before(w.rws.conn.srv.now()) {
// If we're setting a deadline in the past, reset the stream immediately
// so writes after SetWriteDeadline returns will fail.
st.onWriteTimeout()
@@ -2803,9 +2847,9 @@ func (w *responseWriter) SetWriteDeadline(deadline time.Time) error {
if deadline.IsZero() {
st.writeDeadline = nil
} else if st.writeDeadline == nil {
- st.writeDeadline = time.AfterFunc(deadline.Sub(time.Now()), st.onWriteTimeout)
+ st.writeDeadline = sc.srv.afterFunc(deadline.Sub(sc.srv.now()), st.onWriteTimeout)
} else {
- st.writeDeadline.Reset(deadline.Sub(time.Now()))
+ st.writeDeadline.Reset(deadline.Sub(sc.srv.now()))
}
})
return nil
diff --git a/vendor/golang.org/x/net/http2/testsync.go b/vendor/golang.org/x/net/http2/testsync.go
deleted file mode 100644
index 61075bd16..000000000
--- a/vendor/golang.org/x/net/http2/testsync.go
+++ /dev/null
@@ -1,331 +0,0 @@
-// Copyright 2024 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-package http2
-
-import (
- "context"
- "sync"
- "time"
-)
-
-// testSyncHooks coordinates goroutines in tests.
-//
-// For example, a call to ClientConn.RoundTrip involves several goroutines, including:
-// - the goroutine running RoundTrip;
-// - the clientStream.doRequest goroutine, which writes the request; and
-// - the clientStream.readLoop goroutine, which reads the response.
-//
-// Using testSyncHooks, a test can start a RoundTrip and identify when all these goroutines
-// are blocked waiting for some condition such as reading the Request.Body or waiting for
-// flow control to become available.
-//
-// The testSyncHooks also manage timers and synthetic time in tests.
-// This permits us to, for example, start a request and cause it to time out waiting for
-// response headers without resorting to time.Sleep calls.
-type testSyncHooks struct {
- // active/inactive act as a mutex and condition variable.
- //
- // - neither chan contains a value: testSyncHooks is locked.
- // - active contains a value: unlocked, and at least one goroutine is not blocked
- // - inactive contains a value: unlocked, and all goroutines are blocked
- active chan struct{}
- inactive chan struct{}
-
- // goroutine counts
- total int // total goroutines
- condwait map[*sync.Cond]int // blocked in sync.Cond.Wait
- blocked []*testBlockedGoroutine // otherwise blocked
-
- // fake time
- now time.Time
- timers []*fakeTimer
-
- // Transport testing: Report various events.
- newclientconn func(*ClientConn)
- newstream func(*clientStream)
-}
-
-// testBlockedGoroutine is a blocked goroutine.
-type testBlockedGoroutine struct {
- f func() bool // blocked until f returns true
- ch chan struct{} // closed when unblocked
-}
-
-func newTestSyncHooks() *testSyncHooks {
- h := &testSyncHooks{
- active: make(chan struct{}, 1),
- inactive: make(chan struct{}, 1),
- condwait: map[*sync.Cond]int{},
- }
- h.inactive <- struct{}{}
- h.now = time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)
- return h
-}
-
-// lock acquires the testSyncHooks mutex.
-func (h *testSyncHooks) lock() {
- select {
- case <-h.active:
- case <-h.inactive:
- }
-}
-
-// waitInactive waits for all goroutines to become inactive.
-func (h *testSyncHooks) waitInactive() {
- for {
- <-h.inactive
- if !h.unlock() {
- break
- }
- }
-}
-
-// unlock releases the testSyncHooks mutex.
-// It reports whether any goroutines are active.
-func (h *testSyncHooks) unlock() (active bool) {
- // Look for a blocked goroutine which can be unblocked.
- blocked := h.blocked[:0]
- unblocked := false
- for _, b := range h.blocked {
- if !unblocked && b.f() {
- unblocked = true
- close(b.ch)
- } else {
- blocked = append(blocked, b)
- }
- }
- h.blocked = blocked
-
- // Count goroutines blocked on condition variables.
- condwait := 0
- for _, count := range h.condwait {
- condwait += count
- }
-
- if h.total > condwait+len(blocked) {
- h.active <- struct{}{}
- return true
- } else {
- h.inactive <- struct{}{}
- return false
- }
-}
-
-// goRun starts a new goroutine.
-func (h *testSyncHooks) goRun(f func()) {
- h.lock()
- h.total++
- h.unlock()
- go func() {
- defer func() {
- h.lock()
- h.total--
- h.unlock()
- }()
- f()
- }()
-}
-
-// blockUntil indicates that a goroutine is blocked waiting for some condition to become true.
-// It waits until f returns true before proceeding.
-//
-// Example usage:
-//
-// h.blockUntil(func() bool {
-// // Is the context done yet?
-// select {
-// case <-ctx.Done():
-// default:
-// return false
-// }
-// return true
-// })
-// // Wait for the context to become done.
-// <-ctx.Done()
-//
-// The function f passed to blockUntil must be non-blocking and idempotent.
-func (h *testSyncHooks) blockUntil(f func() bool) {
- if f() {
- return
- }
- ch := make(chan struct{})
- h.lock()
- h.blocked = append(h.blocked, &testBlockedGoroutine{
- f: f,
- ch: ch,
- })
- h.unlock()
- <-ch
-}
-
-// broadcast is sync.Cond.Broadcast.
-func (h *testSyncHooks) condBroadcast(cond *sync.Cond) {
- h.lock()
- delete(h.condwait, cond)
- h.unlock()
- cond.Broadcast()
-}
-
-// broadcast is sync.Cond.Wait.
-func (h *testSyncHooks) condWait(cond *sync.Cond) {
- h.lock()
- h.condwait[cond]++
- h.unlock()
-}
-
-// newTimer creates a new fake timer.
-func (h *testSyncHooks) newTimer(d time.Duration) timer {
- h.lock()
- defer h.unlock()
- t := &fakeTimer{
- hooks: h,
- when: h.now.Add(d),
- c: make(chan time.Time),
- }
- h.timers = append(h.timers, t)
- return t
-}
-
-// afterFunc creates a new fake AfterFunc timer.
-func (h *testSyncHooks) afterFunc(d time.Duration, f func()) timer {
- h.lock()
- defer h.unlock()
- t := &fakeTimer{
- hooks: h,
- when: h.now.Add(d),
- f: f,
- }
- h.timers = append(h.timers, t)
- return t
-}
-
-func (h *testSyncHooks) contextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc) {
- ctx, cancel := context.WithCancel(ctx)
- t := h.afterFunc(d, cancel)
- return ctx, func() {
- t.Stop()
- cancel()
- }
-}
-
-func (h *testSyncHooks) timeUntilEvent() time.Duration {
- h.lock()
- defer h.unlock()
- var next time.Time
- for _, t := range h.timers {
- if next.IsZero() || t.when.Before(next) {
- next = t.when
- }
- }
- if d := next.Sub(h.now); d > 0 {
- return d
- }
- return 0
-}
-
-// advance advances time and causes synthetic timers to fire.
-func (h *testSyncHooks) advance(d time.Duration) {
- h.lock()
- defer h.unlock()
- h.now = h.now.Add(d)
- timers := h.timers[:0]
- for _, t := range h.timers {
- t := t // remove after go.mod depends on go1.22
- t.mu.Lock()
- switch {
- case t.when.After(h.now):
- timers = append(timers, t)
- case t.when.IsZero():
- // stopped timer
- default:
- t.when = time.Time{}
- if t.c != nil {
- close(t.c)
- }
- if t.f != nil {
- h.total++
- go func() {
- defer func() {
- h.lock()
- h.total--
- h.unlock()
- }()
- t.f()
- }()
- }
- }
- t.mu.Unlock()
- }
- h.timers = timers
-}
-
-// A timer wraps a time.Timer, or a synthetic equivalent in tests.
-// Unlike time.Timer, timer is single-use: The timer channel is closed when the timer expires.
-type timer interface {
- C() <-chan time.Time
- Stop() bool
- Reset(d time.Duration) bool
-}
-
-// timeTimer implements timer using real time.
-type timeTimer struct {
- t *time.Timer
- c chan time.Time
-}
-
-// newTimeTimer creates a new timer using real time.
-func newTimeTimer(d time.Duration) timer {
- ch := make(chan time.Time)
- t := time.AfterFunc(d, func() {
- close(ch)
- })
- return &timeTimer{t, ch}
-}
-
-// newTimeAfterFunc creates an AfterFunc timer using real time.
-func newTimeAfterFunc(d time.Duration, f func()) timer {
- return &timeTimer{
- t: time.AfterFunc(d, f),
- }
-}
-
-func (t timeTimer) C() <-chan time.Time { return t.c }
-func (t timeTimer) Stop() bool { return t.t.Stop() }
-func (t timeTimer) Reset(d time.Duration) bool { return t.t.Reset(d) }
-
-// fakeTimer implements timer using fake time.
-type fakeTimer struct {
- hooks *testSyncHooks
-
- mu sync.Mutex
- when time.Time // when the timer will fire
- c chan time.Time // closed when the timer fires; mutually exclusive with f
- f func() // called when the timer fires; mutually exclusive with c
-}
-
-func (t *fakeTimer) C() <-chan time.Time { return t.c }
-
-func (t *fakeTimer) Stop() bool {
- t.mu.Lock()
- defer t.mu.Unlock()
- stopped := t.when.IsZero()
- t.when = time.Time{}
- return stopped
-}
-
-func (t *fakeTimer) Reset(d time.Duration) bool {
- if t.c != nil || t.f == nil {
- panic("fakeTimer only supports Reset on AfterFunc timers")
- }
- t.mu.Lock()
- defer t.mu.Unlock()
- t.hooks.lock()
- defer t.hooks.unlock()
- active := !t.when.IsZero()
- t.when = t.hooks.now.Add(d)
- if !active {
- t.hooks.timers = append(t.hooks.timers, t)
- }
- return active
-}
diff --git a/vendor/golang.org/x/net/http2/timer.go b/vendor/golang.org/x/net/http2/timer.go
new file mode 100644
index 000000000..0b1c17b81
--- /dev/null
+++ b/vendor/golang.org/x/net/http2/timer.go
@@ -0,0 +1,20 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+package http2
+
+import "time"
+
+// A timer is a time.Timer, as an interface which can be replaced in tests.
+type timer = interface {
+ C() <-chan time.Time
+ Reset(d time.Duration) bool
+ Stop() bool
+}
+
+// timeTimer adapts a time.Timer to the timer interface.
+type timeTimer struct {
+ *time.Timer
+}
+
+func (t timeTimer) C() <-chan time.Time { return t.Timer.C }
diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go
index 2fa49490c..98a49c6b6 100644
--- a/vendor/golang.org/x/net/http2/transport.go
+++ b/vendor/golang.org/x/net/http2/transport.go
@@ -185,7 +185,45 @@ type Transport struct {
connPoolOnce sync.Once
connPoolOrDef ClientConnPool // non-nil version of ConnPool
- syncHooks *testSyncHooks
+ *transportTestHooks
+}
+
+// Hook points used for testing.
+// Outside of tests, t.transportTestHooks is nil and these all have minimal implementations.
+// Inside tests, see the testSyncHooks function docs.
+
+type transportTestHooks struct {
+ newclientconn func(*ClientConn)
+ group synctestGroupInterface
+}
+
+func (t *Transport) markNewGoroutine() {
+ if t != nil && t.transportTestHooks != nil {
+ t.transportTestHooks.group.Join()
+ }
+}
+
+// newTimer creates a new time.Timer, or a synthetic timer in tests.
+func (t *Transport) newTimer(d time.Duration) timer {
+ if t.transportTestHooks != nil {
+ return t.transportTestHooks.group.NewTimer(d)
+ }
+ return timeTimer{time.NewTimer(d)}
+}
+
+// afterFunc creates a new time.AfterFunc timer, or a synthetic timer in tests.
+func (t *Transport) afterFunc(d time.Duration, f func()) timer {
+ if t.transportTestHooks != nil {
+ return t.transportTestHooks.group.AfterFunc(d, f)
+ }
+ return timeTimer{time.AfterFunc(d, f)}
+}
+
+func (t *Transport) contextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc) {
+ if t.transportTestHooks != nil {
+ return t.transportTestHooks.group.ContextWithTimeout(ctx, d)
+ }
+ return context.WithTimeout(ctx, d)
}
func (t *Transport) maxHeaderListSize() uint32 {
@@ -352,60 +390,6 @@ type ClientConn struct {
werr error // first write error that has occurred
hbuf bytes.Buffer // HPACK encoder writes into this
henc *hpack.Encoder
-
- syncHooks *testSyncHooks // can be nil
-}
-
-// Hook points used for testing.
-// Outside of tests, cc.syncHooks is nil and these all have minimal implementations.
-// Inside tests, see the testSyncHooks function docs.
-
-// goRun starts a new goroutine.
-func (cc *ClientConn) goRun(f func()) {
- if cc.syncHooks != nil {
- cc.syncHooks.goRun(f)
- return
- }
- go f()
-}
-
-// condBroadcast is cc.cond.Broadcast.
-func (cc *ClientConn) condBroadcast() {
- if cc.syncHooks != nil {
- cc.syncHooks.condBroadcast(cc.cond)
- }
- cc.cond.Broadcast()
-}
-
-// condWait is cc.cond.Wait.
-func (cc *ClientConn) condWait() {
- if cc.syncHooks != nil {
- cc.syncHooks.condWait(cc.cond)
- }
- cc.cond.Wait()
-}
-
-// newTimer creates a new time.Timer, or a synthetic timer in tests.
-func (cc *ClientConn) newTimer(d time.Duration) timer {
- if cc.syncHooks != nil {
- return cc.syncHooks.newTimer(d)
- }
- return newTimeTimer(d)
-}
-
-// afterFunc creates a new time.AfterFunc timer, or a synthetic timer in tests.
-func (cc *ClientConn) afterFunc(d time.Duration, f func()) timer {
- if cc.syncHooks != nil {
- return cc.syncHooks.afterFunc(d, f)
- }
- return newTimeAfterFunc(d, f)
-}
-
-func (cc *ClientConn) contextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc) {
- if cc.syncHooks != nil {
- return cc.syncHooks.contextWithTimeout(ctx, d)
- }
- return context.WithTimeout(ctx, d)
}
// clientStream is the state for a single HTTP/2 stream. One of these
@@ -487,7 +471,7 @@ func (cs *clientStream) abortStreamLocked(err error) {
// TODO(dneil): Clean up tests where cs.cc.cond is nil.
if cs.cc.cond != nil {
// Wake up writeRequestBody if it is waiting on flow control.
- cs.cc.condBroadcast()
+ cs.cc.cond.Broadcast()
}
}
@@ -497,7 +481,7 @@ func (cs *clientStream) abortRequestBodyWrite() {
defer cc.mu.Unlock()
if cs.reqBody != nil && cs.reqBodyClosed == nil {
cs.closeReqBodyLocked()
- cc.condBroadcast()
+ cc.cond.Broadcast()
}
}
@@ -507,10 +491,11 @@ func (cs *clientStream) closeReqBodyLocked() {
}
cs.reqBodyClosed = make(chan struct{})
reqBodyClosed := cs.reqBodyClosed
- cs.cc.goRun(func() {
+ go func() {
+ cs.cc.t.markNewGoroutine()
cs.reqBody.Close()
close(reqBodyClosed)
- })
+ }()
}
type stickyErrWriter struct {
@@ -626,21 +611,7 @@ func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Res
backoff := float64(uint(1) << (uint(retry) - 1))
backoff += backoff * (0.1 * mathrand.Float64())
d := time.Second * time.Duration(backoff)
- var tm timer
- if t.syncHooks != nil {
- tm = t.syncHooks.newTimer(d)
- t.syncHooks.blockUntil(func() bool {
- select {
- case <-tm.C():
- case <-req.Context().Done():
- default:
- return false
- }
- return true
- })
- } else {
- tm = newTimeTimer(d)
- }
+ tm := t.newTimer(d)
select {
case <-tm.C():
t.vlogf("RoundTrip retrying after failure: %v", roundTripErr)
@@ -725,8 +696,8 @@ func canRetryError(err error) bool {
}
func (t *Transport) dialClientConn(ctx context.Context, addr string, singleUse bool) (*ClientConn, error) {
- if t.syncHooks != nil {
- return t.newClientConn(nil, singleUse, t.syncHooks)
+ if t.transportTestHooks != nil {
+ return t.newClientConn(nil, singleUse)
}
host, _, err := net.SplitHostPort(addr)
if err != nil {
@@ -736,7 +707,7 @@ func (t *Transport) dialClientConn(ctx context.Context, addr string, singleUse b
if err != nil {
return nil, err
}
- return t.newClientConn(tconn, singleUse, nil)
+ return t.newClientConn(tconn, singleUse)
}
func (t *Transport) newTLSConfig(host string) *tls.Config {
@@ -802,10 +773,10 @@ func (t *Transport) maxEncoderHeaderTableSize() uint32 {
}
func (t *Transport) NewClientConn(c net.Conn) (*ClientConn, error) {
- return t.newClientConn(c, t.disableKeepAlives(), nil)
+ return t.newClientConn(c, t.disableKeepAlives())
}
-func (t *Transport) newClientConn(c net.Conn, singleUse bool, hooks *testSyncHooks) (*ClientConn, error) {
+func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, error) {
cc := &ClientConn{
t: t,
tconn: c,
@@ -820,16 +791,12 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool, hooks *testSyncHoo
wantSettingsAck: true,
pings: make(map[[8]byte]chan struct{}),
reqHeaderMu: make(chan struct{}, 1),
- syncHooks: hooks,
}
- if hooks != nil {
- hooks.newclientconn(cc)
+ if t.transportTestHooks != nil {
+ t.markNewGoroutine()
+ t.transportTestHooks.newclientconn(cc)
c = cc.tconn
}
- if d := t.idleConnTimeout(); d != 0 {
- cc.idleTimeout = d
- cc.idleTimer = cc.afterFunc(d, cc.onIdleTimeout)
- }
if VerboseLogs {
t.vlogf("http2: Transport creating client conn %p to %v", cc, c.RemoteAddr())
}
@@ -893,7 +860,13 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool, hooks *testSyncHoo
return nil, cc.werr
}
- cc.goRun(cc.readLoop)
+ // Start the idle timer after the connection is fully initialized.
+ if d := t.idleConnTimeout(); d != 0 {
+ cc.idleTimeout = d
+ cc.idleTimer = t.afterFunc(d, cc.onIdleTimeout)
+ }
+
+ go cc.readLoop()
return cc, nil
}
@@ -901,7 +874,7 @@ func (cc *ClientConn) healthCheck() {
pingTimeout := cc.t.pingTimeout()
// We don't need to periodically ping in the health check, because the readLoop of ClientConn will
// trigger the healthCheck again if there is no frame received.
- ctx, cancel := cc.contextWithTimeout(context.Background(), pingTimeout)
+ ctx, cancel := cc.t.contextWithTimeout(context.Background(), pingTimeout)
defer cancel()
cc.vlogf("http2: Transport sending health check")
err := cc.Ping(ctx)
@@ -1144,7 +1117,8 @@ func (cc *ClientConn) Shutdown(ctx context.Context) error {
// Wait for all in-flight streams to complete or connection to close
done := make(chan struct{})
cancelled := false // guarded by cc.mu
- cc.goRun(func() {
+ go func() {
+ cc.t.markNewGoroutine()
cc.mu.Lock()
defer cc.mu.Unlock()
for {
@@ -1156,9 +1130,9 @@ func (cc *ClientConn) Shutdown(ctx context.Context) error {
if cancelled {
break
}
- cc.condWait()
+ cc.cond.Wait()
}
- })
+ }()
shutdownEnterWaitStateHook()
select {
case <-done:
@@ -1168,7 +1142,7 @@ func (cc *ClientConn) Shutdown(ctx context.Context) error {
cc.mu.Lock()
// Free the goroutine above
cancelled = true
- cc.condBroadcast()
+ cc.cond.Broadcast()
cc.mu.Unlock()
return ctx.Err()
}
@@ -1206,7 +1180,7 @@ func (cc *ClientConn) closeForError(err error) {
for _, cs := range cc.streams {
cs.abortStreamLocked(err)
}
- cc.condBroadcast()
+ cc.cond.Broadcast()
cc.mu.Unlock()
cc.closeConn()
}
@@ -1321,23 +1295,30 @@ func (cc *ClientConn) roundTrip(req *http.Request, streamf func(*clientStream))
respHeaderRecv: make(chan struct{}),
donec: make(chan struct{}),
}
- cc.goRun(func() {
- cs.doRequest(req)
- })
+
+ // TODO(bradfitz): this is a copy of the logic in net/http. Unify somewhere?
+ if !cc.t.disableCompression() &&
+ req.Header.Get("Accept-Encoding") == "" &&
+ req.Header.Get("Range") == "" &&
+ !cs.isHead {
+ // Request gzip only, not deflate. Deflate is ambiguous and
+ // not as universally supported anyway.
+ // See: https://zlib.net/zlib_faq.html#faq39
+ //
+ // Note that we don't request this for HEAD requests,
+ // due to a bug in nginx:
+ // http://trac.nginx.org/nginx/ticket/358
+ // https://golang.org/issue/5522
+ //
+ // We don't request gzip if the request is for a range, since
+ // auto-decoding a portion of a gzipped document will just fail
+ // anyway. See https://golang.org/issue/8923
+ cs.requestedGzip = true
+ }
+
+ go cs.doRequest(req, streamf)
waitDone := func() error {
- if cc.syncHooks != nil {
- cc.syncHooks.blockUntil(func() bool {
- select {
- case <-cs.donec:
- case <-ctx.Done():
- case <-cs.reqCancel:
- default:
- return false
- }
- return true
- })
- }
select {
case <-cs.donec:
return nil
@@ -1398,24 +1379,7 @@ func (cc *ClientConn) roundTrip(req *http.Request, streamf func(*clientStream))
return err
}
- if streamf != nil {
- streamf(cs)
- }
-
for {
- if cc.syncHooks != nil {
- cc.syncHooks.blockUntil(func() bool {
- select {
- case <-cs.respHeaderRecv:
- case <-cs.abort:
- case <-ctx.Done():
- case <-cs.reqCancel:
- default:
- return false
- }
- return true
- })
- }
select {
case <-cs.respHeaderRecv:
return handleResponseHeaders()
@@ -1445,8 +1409,9 @@ func (cc *ClientConn) roundTrip(req *http.Request, streamf func(*clientStream))
// doRequest runs for the duration of the request lifetime.
//
// It sends the request and performs post-request cleanup (closing Request.Body, etc.).
-func (cs *clientStream) doRequest(req *http.Request) {
- err := cs.writeRequest(req)
+func (cs *clientStream) doRequest(req *http.Request, streamf func(*clientStream)) {
+ cs.cc.t.markNewGoroutine()
+ err := cs.writeRequest(req, streamf)
cs.cleanupWriteRequest(err)
}
@@ -1457,7 +1422,7 @@ func (cs *clientStream) doRequest(req *http.Request) {
//
// It returns non-nil if the request ends otherwise.
// If the returned error is StreamError, the error Code may be used in resetting the stream.
-func (cs *clientStream) writeRequest(req *http.Request) (err error) {
+func (cs *clientStream) writeRequest(req *http.Request, streamf func(*clientStream)) (err error) {
cc := cs.cc
ctx := cs.ctx
@@ -1471,21 +1436,6 @@ func (cs *clientStream) writeRequest(req *http.Request) (err error) {
if cc.reqHeaderMu == nil {
panic("RoundTrip on uninitialized ClientConn") // for tests
}
- var newStreamHook func(*clientStream)
- if cc.syncHooks != nil {
- newStreamHook = cc.syncHooks.newstream
- cc.syncHooks.blockUntil(func() bool {
- select {
- case cc.reqHeaderMu <- struct{}{}:
- <-cc.reqHeaderMu
- case <-cs.reqCancel:
- case <-ctx.Done():
- default:
- return false
- }
- return true
- })
- }
select {
case cc.reqHeaderMu <- struct{}{}:
case <-cs.reqCancel:
@@ -1510,28 +1460,8 @@ func (cs *clientStream) writeRequest(req *http.Request) (err error) {
}
cc.mu.Unlock()
- if newStreamHook != nil {
- newStreamHook(cs)
- }
-
- // TODO(bradfitz): this is a copy of the logic in net/http. Unify somewhere?
- if !cc.t.disableCompression() &&
- req.Header.Get("Accept-Encoding") == "" &&
- req.Header.Get("Range") == "" &&
- !cs.isHead {
- // Request gzip only, not deflate. Deflate is ambiguous and
- // not as universally supported anyway.
- // See: https://zlib.net/zlib_faq.html#faq39
- //
- // Note that we don't request this for HEAD requests,
- // due to a bug in nginx:
- // http://trac.nginx.org/nginx/ticket/358
- // https://golang.org/issue/5522
- //
- // We don't request gzip if the request is for a range, since
- // auto-decoding a portion of a gzipped document will just fail
- // anyway. See https://golang.org/issue/8923
- cs.requestedGzip = true
+ if streamf != nil {
+ streamf(cs)
}
continueTimeout := cc.t.expectContinueTimeout()
@@ -1594,7 +1524,7 @@ func (cs *clientStream) writeRequest(req *http.Request) (err error) {
var respHeaderTimer <-chan time.Time
var respHeaderRecv chan struct{}
if d := cc.responseHeaderTimeout(); d != 0 {
- timer := cc.newTimer(d)
+ timer := cc.t.newTimer(d)
defer timer.Stop()
respHeaderTimer = timer.C()
respHeaderRecv = cs.respHeaderRecv
@@ -1603,21 +1533,6 @@ func (cs *clientStream) writeRequest(req *http.Request) (err error) {
// or until the request is aborted (via context, error, or otherwise),
// whichever comes first.
for {
- if cc.syncHooks != nil {
- cc.syncHooks.blockUntil(func() bool {
- select {
- case <-cs.peerClosed:
- case <-respHeaderTimer:
- case <-respHeaderRecv:
- case <-cs.abort:
- case <-ctx.Done():
- case <-cs.reqCancel:
- default:
- return false
- }
- return true
- })
- }
select {
case <-cs.peerClosed:
return nil
@@ -1766,7 +1681,7 @@ func (cc *ClientConn) awaitOpenSlotForStreamLocked(cs *clientStream) error {
return nil
}
cc.pendingRequests++
- cc.condWait()
+ cc.cond.Wait()
cc.pendingRequests--
select {
case <-cs.abort:
@@ -2028,7 +1943,7 @@ func (cs *clientStream) awaitFlowControl(maxBytes int) (taken int32, err error)
cs.flow.take(take)
return take, nil
}
- cc.condWait()
+ cc.cond.Wait()
}
}
@@ -2311,7 +2226,7 @@ func (cc *ClientConn) forgetStreamID(id uint32) {
}
// Wake up writeRequestBody via clientStream.awaitFlowControl and
// wake up RoundTrip if there is a pending request.
- cc.condBroadcast()
+ cc.cond.Broadcast()
closeOnIdle := cc.singleUse || cc.doNotReuse || cc.t.disableKeepAlives() || cc.goAway != nil
if closeOnIdle && cc.streamsReserved == 0 && len(cc.streams) == 0 {
@@ -2333,6 +2248,7 @@ type clientConnReadLoop struct {
// readLoop runs in its own goroutine and reads and dispatches frames.
func (cc *ClientConn) readLoop() {
+ cc.t.markNewGoroutine()
rl := &clientConnReadLoop{cc: cc}
defer rl.cleanup()
cc.readerErr = rl.run()
@@ -2399,7 +2315,7 @@ func (rl *clientConnReadLoop) cleanup() {
cs.abortStreamLocked(err)
}
}
- cc.condBroadcast()
+ cc.cond.Broadcast()
cc.mu.Unlock()
}
@@ -2436,7 +2352,7 @@ func (rl *clientConnReadLoop) run() error {
readIdleTimeout := cc.t.ReadIdleTimeout
var t timer
if readIdleTimeout != 0 {
- t = cc.afterFunc(readIdleTimeout, cc.healthCheck)
+ t = cc.t.afterFunc(readIdleTimeout, cc.healthCheck)
}
for {
f, err := cc.fr.ReadFrame()
@@ -3034,7 +2950,7 @@ func (rl *clientConnReadLoop) processSettingsNoWrite(f *SettingsFrame) error {
for _, cs := range cc.streams {
cs.flow.add(delta)
}
- cc.condBroadcast()
+ cc.cond.Broadcast()
cc.initialWindowSize = s.Val
case SettingHeaderTableSize:
@@ -3089,7 +3005,7 @@ func (rl *clientConnReadLoop) processWindowUpdate(f *WindowUpdateFrame) error {
return ConnectionError(ErrCodeFlowControl)
}
- cc.condBroadcast()
+ cc.cond.Broadcast()
return nil
}
@@ -3133,7 +3049,8 @@ func (cc *ClientConn) Ping(ctx context.Context) error {
}
var pingError error
errc := make(chan struct{})
- cc.goRun(func() {
+ go func() {
+ cc.t.markNewGoroutine()
cc.wmu.Lock()
defer cc.wmu.Unlock()
if pingError = cc.fr.WritePing(false, p); pingError != nil {
@@ -3144,20 +3061,7 @@ func (cc *ClientConn) Ping(ctx context.Context) error {
close(errc)
return
}
- })
- if cc.syncHooks != nil {
- cc.syncHooks.blockUntil(func() bool {
- select {
- case <-c:
- case <-errc:
- case <-ctx.Done():
- case <-cc.readerDone:
- default:
- return false
- }
- return true
- })
- }
+ }()
select {
case <-c:
return nil
diff --git a/vendor/golang.org/x/net/http2/writesched_priority.go b/vendor/golang.org/x/net/http2/writesched_priority.go
index 0a242c669..f6783339d 100644
--- a/vendor/golang.org/x/net/http2/writesched_priority.go
+++ b/vendor/golang.org/x/net/http2/writesched_priority.go
@@ -443,8 +443,8 @@ func (ws *priorityWriteScheduler) addClosedOrIdleNode(list *[]*priorityNode, max
}
func (ws *priorityWriteScheduler) removeNode(n *priorityNode) {
- for k := n.kids; k != nil; k = k.next {
- k.setParent(n.parent)
+ for n.kids != nil {
+ n.kids.setParent(n.parent)
}
n.setParent(nil)
delete(ws.nodes, n.id)
diff --git a/vendor/golang.org/x/oauth2/google/google.go b/vendor/golang.org/x/oauth2/google/google.go
index ba931c2c3..7b82e7a08 100644
--- a/vendor/golang.org/x/oauth2/google/google.go
+++ b/vendor/golang.org/x/oauth2/google/google.go
@@ -252,7 +252,10 @@ func (f *credentialsFile) tokenSource(ctx context.Context, params CredentialsPar
// Further information about retrieving access tokens from the GCE metadata
// server can be found at https://cloud.google.com/compute/docs/authentication.
func ComputeTokenSource(account string, scope ...string) oauth2.TokenSource {
- return computeTokenSource(account, 0, scope...)
+ // refresh 3 minutes and 45 seconds early. The shortest MDS cache is currently 4 minutes, so any
+ // refreshes earlier are a waste of compute.
+ earlyExpirySecs := 225 * time.Second
+ return computeTokenSource(account, earlyExpirySecs, scope...)
}
func computeTokenSource(account string, earlyExpiry time.Duration, scope ...string) oauth2.TokenSource {
diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh
index fdcaa974d..4ed2e488b 100644
--- a/vendor/golang.org/x/sys/unix/mkerrors.sh
+++ b/vendor/golang.org/x/sys/unix/mkerrors.sh
@@ -263,6 +263,7 @@ struct ltchars {
#include
#include
#include
+#include
#include
#include
#include
@@ -549,6 +550,7 @@ ccflags="$@"
$2 !~ "NLA_TYPE_MASK" &&
$2 !~ /^RTC_VL_(ACCURACY|BACKUP|DATA)/ &&
$2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTC|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P|NETNSA)_/ ||
+ $2 ~ /^SOCK_|SK_DIAG_|SKNLGRP_$/ ||
$2 ~ /^FIORDCHK$/ ||
$2 ~ /^SIOC/ ||
$2 ~ /^TIOC/ ||
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go
index 93a38a97d..877a62b47 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go
@@ -502,6 +502,7 @@ const (
BPF_IMM = 0x0
BPF_IND = 0x40
BPF_JA = 0x0
+ BPF_JCOND = 0xe0
BPF_JEQ = 0x10
BPF_JGE = 0x30
BPF_JGT = 0x20
@@ -657,6 +658,9 @@ const (
CAN_NPROTO = 0x8
CAN_RAW = 0x1
CAN_RAW_FILTER_MAX = 0x200
+ CAN_RAW_XL_VCID_RX_FILTER = 0x4
+ CAN_RAW_XL_VCID_TX_PASS = 0x2
+ CAN_RAW_XL_VCID_TX_SET = 0x1
CAN_RTR_FLAG = 0x40000000
CAN_SFF_ID_BITS = 0xb
CAN_SFF_MASK = 0x7ff
@@ -1339,6 +1343,7 @@ const (
F_OFD_SETLK = 0x25
F_OFD_SETLKW = 0x26
F_OK = 0x0
+ F_SEAL_EXEC = 0x20
F_SEAL_FUTURE_WRITE = 0x10
F_SEAL_GROW = 0x4
F_SEAL_SEAL = 0x1
@@ -1627,6 +1632,7 @@ const (
IP_FREEBIND = 0xf
IP_HDRINCL = 0x3
IP_IPSEC_POLICY = 0x10
+ IP_LOCAL_PORT_RANGE = 0x33
IP_MAXPACKET = 0xffff
IP_MAX_MEMBERSHIPS = 0x14
IP_MF = 0x2000
@@ -1653,6 +1659,7 @@ const (
IP_PMTUDISC_OMIT = 0x5
IP_PMTUDISC_PROBE = 0x3
IP_PMTUDISC_WANT = 0x1
+ IP_PROTOCOL = 0x34
IP_RECVERR = 0xb
IP_RECVERR_RFC4884 = 0x1a
IP_RECVFRAGSIZE = 0x19
@@ -2169,7 +2176,7 @@ const (
NFT_SECMARK_CTX_MAXLEN = 0x100
NFT_SET_MAXNAMELEN = 0x100
NFT_SOCKET_MAX = 0x3
- NFT_TABLE_F_MASK = 0x3
+ NFT_TABLE_F_MASK = 0x7
NFT_TABLE_MAXNAMELEN = 0x100
NFT_TRACETYPE_MAX = 0x3
NFT_TUNNEL_F_MASK = 0x7
@@ -2403,6 +2410,7 @@ const (
PERF_RECORD_MISC_USER = 0x2
PERF_SAMPLE_BRANCH_PLM_ALL = 0x7
PERF_SAMPLE_WEIGHT_TYPE = 0x1004000
+ PID_FS_MAGIC = 0x50494446
PIPEFS_MAGIC = 0x50495045
PPPIOCGNPMODE = 0xc008744c
PPPIOCNEWUNIT = 0xc004743e
@@ -2896,8 +2904,9 @@ const (
RWF_APPEND = 0x10
RWF_DSYNC = 0x2
RWF_HIPRI = 0x1
+ RWF_NOAPPEND = 0x20
RWF_NOWAIT = 0x8
- RWF_SUPPORTED = 0x1f
+ RWF_SUPPORTED = 0x3f
RWF_SYNC = 0x4
RWF_WRITE_LIFE_NOT_SET = 0x0
SCHED_BATCH = 0x3
@@ -2918,7 +2927,9 @@ const (
SCHED_RESET_ON_FORK = 0x40000000
SCHED_RR = 0x2
SCM_CREDENTIALS = 0x2
+ SCM_PIDFD = 0x4
SCM_RIGHTS = 0x1
+ SCM_SECURITY = 0x3
SCM_TIMESTAMP = 0x1d
SC_LOG_FLUSH = 0x100000
SECCOMP_ADDFD_FLAG_SEND = 0x2
@@ -3051,6 +3062,8 @@ const (
SIOCSMIIREG = 0x8949
SIOCSRARP = 0x8962
SIOCWANDEV = 0x894a
+ SK_DIAG_BPF_STORAGE_MAX = 0x3
+ SK_DIAG_BPF_STORAGE_REQ_MAX = 0x1
SMACK_MAGIC = 0x43415d53
SMART_AUTOSAVE = 0xd2
SMART_AUTO_OFFLINE = 0xdb
@@ -3071,6 +3084,8 @@ const (
SOCKFS_MAGIC = 0x534f434b
SOCK_BUF_LOCK_MASK = 0x3
SOCK_DCCP = 0x6
+ SOCK_DESTROY = 0x15
+ SOCK_DIAG_BY_FAMILY = 0x14
SOCK_IOC_TYPE = 0x89
SOCK_PACKET = 0xa
SOCK_RAW = 0x3
@@ -3260,6 +3275,7 @@ const (
TCP_MAX_WINSHIFT = 0xe
TCP_MD5SIG = 0xe
TCP_MD5SIG_EXT = 0x20
+ TCP_MD5SIG_FLAG_IFINDEX = 0x2
TCP_MD5SIG_FLAG_PREFIX = 0x1
TCP_MD5SIG_MAXKEYLEN = 0x50
TCP_MSS = 0x200
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go
index 42ff8c3c1..e4bc0bd57 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go
@@ -118,6 +118,7 @@ const (
IXOFF = 0x1000
IXON = 0x400
MAP_32BIT = 0x40
+ MAP_ABOVE4G = 0x80
MAP_ANON = 0x20
MAP_ANONYMOUS = 0x20
MAP_DENYWRITE = 0x800
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
index dca436004..689317afd 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
@@ -118,6 +118,7 @@ const (
IXOFF = 0x1000
IXON = 0x400
MAP_32BIT = 0x40
+ MAP_ABOVE4G = 0x80
MAP_ANON = 0x20
MAP_ANONYMOUS = 0x20
MAP_DENYWRITE = 0x800
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
index d8cae6d15..14270508b 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
@@ -87,6 +87,7 @@ const (
FICLONE = 0x40049409
FICLONERANGE = 0x4020940d
FLUSHO = 0x1000
+ FPMR_MAGIC = 0x46504d52
FPSIMD_MAGIC = 0x46508001
FS_IOC_ENABLE_VERITY = 0x40806685
FS_IOC_GETFLAGS = 0x80086601
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go
index 0036746ea..4740b8348 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go
@@ -4605,7 +4605,7 @@ const (
NL80211_ATTR_MAC_HINT = 0xc8
NL80211_ATTR_MAC_MASK = 0xd7
NL80211_ATTR_MAX_AP_ASSOC_STA = 0xca
- NL80211_ATTR_MAX = 0x149
+ NL80211_ATTR_MAX = 0x14a
NL80211_ATTR_MAX_CRIT_PROT_DURATION = 0xb4
NL80211_ATTR_MAX_CSA_COUNTERS = 0xce
NL80211_ATTR_MAX_MATCH_SETS = 0x85
@@ -5209,7 +5209,7 @@ const (
NL80211_FREQUENCY_ATTR_GO_CONCURRENT = 0xf
NL80211_FREQUENCY_ATTR_INDOOR_ONLY = 0xe
NL80211_FREQUENCY_ATTR_IR_CONCURRENT = 0xf
- NL80211_FREQUENCY_ATTR_MAX = 0x1f
+ NL80211_FREQUENCY_ATTR_MAX = 0x20
NL80211_FREQUENCY_ATTR_MAX_TX_POWER = 0x6
NL80211_FREQUENCY_ATTR_NO_10MHZ = 0x11
NL80211_FREQUENCY_ATTR_NO_160MHZ = 0xc
@@ -5703,7 +5703,7 @@ const (
NL80211_STA_FLAG_ASSOCIATED = 0x7
NL80211_STA_FLAG_AUTHENTICATED = 0x5
NL80211_STA_FLAG_AUTHORIZED = 0x1
- NL80211_STA_FLAG_MAX = 0x7
+ NL80211_STA_FLAG_MAX = 0x8
NL80211_STA_FLAG_MAX_OLD_API = 0x6
NL80211_STA_FLAG_MFP = 0x4
NL80211_STA_FLAG_SHORT_PREAMBLE = 0x2
@@ -6001,3 +6001,34 @@ type CachestatRange struct {
Off uint64
Len uint64
}
+
+const (
+ SK_MEMINFO_RMEM_ALLOC = 0x0
+ SK_MEMINFO_RCVBUF = 0x1
+ SK_MEMINFO_WMEM_ALLOC = 0x2
+ SK_MEMINFO_SNDBUF = 0x3
+ SK_MEMINFO_FWD_ALLOC = 0x4
+ SK_MEMINFO_WMEM_QUEUED = 0x5
+ SK_MEMINFO_OPTMEM = 0x6
+ SK_MEMINFO_BACKLOG = 0x7
+ SK_MEMINFO_DROPS = 0x8
+ SK_MEMINFO_VARS = 0x9
+ SKNLGRP_NONE = 0x0
+ SKNLGRP_INET_TCP_DESTROY = 0x1
+ SKNLGRP_INET_UDP_DESTROY = 0x2
+ SKNLGRP_INET6_TCP_DESTROY = 0x3
+ SKNLGRP_INET6_UDP_DESTROY = 0x4
+ SK_DIAG_BPF_STORAGE_REQ_NONE = 0x0
+ SK_DIAG_BPF_STORAGE_REQ_MAP_FD = 0x1
+ SK_DIAG_BPF_STORAGE_REP_NONE = 0x0
+ SK_DIAG_BPF_STORAGE = 0x1
+ SK_DIAG_BPF_STORAGE_NONE = 0x0
+ SK_DIAG_BPF_STORAGE_PAD = 0x1
+ SK_DIAG_BPF_STORAGE_MAP_ID = 0x2
+ SK_DIAG_BPF_STORAGE_MAP_VALUE = 0x3
+)
+
+type SockDiagReq struct {
+ Family uint8
+ Protocol uint8
+}
diff --git a/vendor/golang.org/x/sys/windows/security_windows.go b/vendor/golang.org/x/sys/windows/security_windows.go
index 26be94a8a..6f7d2ac70 100644
--- a/vendor/golang.org/x/sys/windows/security_windows.go
+++ b/vendor/golang.org/x/sys/windows/security_windows.go
@@ -68,6 +68,7 @@ type UserInfo10 struct {
//sys NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) = netapi32.NetUserGetInfo
//sys NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (neterr error) = netapi32.NetGetJoinInformation
//sys NetApiBufferFree(buf *byte) (neterr error) = netapi32.NetApiBufferFree
+//sys NetUserEnum(serverName *uint16, level uint32, filter uint32, buf **byte, prefMaxLen uint32, entriesRead *uint32, totalEntries *uint32, resumeHandle *uint32) (neterr error) = netapi32.NetUserEnum
const (
// do not reorder
diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go
index 5c6035ddf..9f73df75b 100644
--- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go
+++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go
@@ -401,6 +401,7 @@ var (
procTransmitFile = modmswsock.NewProc("TransmitFile")
procNetApiBufferFree = modnetapi32.NewProc("NetApiBufferFree")
procNetGetJoinInformation = modnetapi32.NewProc("NetGetJoinInformation")
+ procNetUserEnum = modnetapi32.NewProc("NetUserEnum")
procNetUserGetInfo = modnetapi32.NewProc("NetUserGetInfo")
procNtCreateFile = modntdll.NewProc("NtCreateFile")
procNtCreateNamedPipeFile = modntdll.NewProc("NtCreateNamedPipeFile")
@@ -3486,6 +3487,14 @@ func NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (nete
return
}
+func NetUserEnum(serverName *uint16, level uint32, filter uint32, buf **byte, prefMaxLen uint32, entriesRead *uint32, totalEntries *uint32, resumeHandle *uint32) (neterr error) {
+ r0, _, _ := syscall.Syscall9(procNetUserEnum.Addr(), 8, uintptr(unsafe.Pointer(serverName)), uintptr(level), uintptr(filter), uintptr(unsafe.Pointer(buf)), uintptr(prefMaxLen), uintptr(unsafe.Pointer(entriesRead)), uintptr(unsafe.Pointer(totalEntries)), uintptr(unsafe.Pointer(resumeHandle)), 0)
+ if r0 != 0 {
+ neterr = syscall.Errno(r0)
+ }
+ return
+}
+
func NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) {
r0, _, _ := syscall.Syscall6(procNetUserGetInfo.Addr(), 4, uintptr(unsafe.Pointer(serverName)), uintptr(unsafe.Pointer(userName)), uintptr(level), uintptr(unsafe.Pointer(buf)), 0, 0)
if r0 != 0 {
diff --git a/vendor/google.golang.org/api/internal/version.go b/vendor/google.golang.org/api/internal/version.go
index 28c324a64..caf844136 100644
--- a/vendor/google.golang.org/api/internal/version.go
+++ b/vendor/google.golang.org/api/internal/version.go
@@ -5,4 +5,4 @@
package internal
// Version is the current tagged release of the library.
-const Version = "0.181.0"
+const Version = "0.183.0"
diff --git a/vendor/google.golang.org/api/storage/v1/storage-api.json b/vendor/google.golang.org/api/storage/v1/storage-api.json
index 1b4be6993..160800c2b 100644
--- a/vendor/google.golang.org/api/storage/v1/storage-api.json
+++ b/vendor/google.golang.org/api/storage/v1/storage-api.json
@@ -33,7 +33,7 @@
"location": "me-central2"
}
],
- "etag": "\"33303333323233383838323039393532373539\"",
+ "etag": "\"3132383134303835313436343635393933303731\"",
"icons": {
"x16": "https://www.google.com/images/icons/product/cloud_storage-16.png",
"x32": "https://www.google.com/images/icons/product/cloud_storage-32.png"
@@ -681,6 +681,38 @@
"https://www.googleapis.com/auth/devstorage.full_control"
]
},
+ "getStorageLayout": {
+ "description": "Returns the storage layout configuration for the specified bucket. Note that this operation requires storage.objects.list permission.",
+ "httpMethod": "GET",
+ "id": "storage.buckets.getStorageLayout",
+ "parameterOrder": [
+ "bucket"
+ ],
+ "parameters": {
+ "bucket": {
+ "description": "Name of a bucket.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ },
+ "prefix": {
+ "description": "An optional prefix used for permission check. It is useful when the caller only has storage.objects.list permission under a specific prefix.",
+ "location": "query",
+ "type": "string"
+ }
+ },
+ "path": "b/{bucket}/storageLayout",
+ "response": {
+ "$ref": "BucketStorageLayout"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_only",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
"insert": {
"description": "Creates a new bucket.",
"httpMethod": "POST",
@@ -4043,7 +4075,7 @@
}
}
},
- "revision": "20240319",
+ "revision": "20240524",
"rootUrl": "https://storage.googleapis.com/",
"schemas": {
"AnywhereCache": {
@@ -4662,6 +4694,53 @@
},
"type": "object"
},
+ "BucketStorageLayout": {
+ "description": "The storage layout configuration of a bucket.",
+ "id": "BucketStorageLayout",
+ "properties": {
+ "bucket": {
+ "description": "The name of the bucket.",
+ "type": "string"
+ },
+ "customPlacementConfig": {
+ "description": "The bucket's custom placement configuration for Custom Dual Regions.",
+ "properties": {
+ "dataLocations": {
+ "description": "The list of regional locations in which data is placed.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ }
+ },
+ "type": "object"
+ },
+ "hierarchicalNamespace": {
+ "description": "The bucket's hierarchical namespace configuration.",
+ "properties": {
+ "enabled": {
+ "description": "When set to true, hierarchical namespace is enabled for this bucket.",
+ "type": "boolean"
+ }
+ },
+ "type": "object"
+ },
+ "kind": {
+ "default": "storage#storageLayout",
+ "description": "The kind of item this is. For storage layout, this is always storage#storageLayout.",
+ "type": "string"
+ },
+ "location": {
+ "description": "The location of the bucket.",
+ "type": "string"
+ },
+ "locationType": {
+ "description": "The type of the bucket location.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
"Buckets": {
"description": "A list of buckets.",
"id": "Buckets",
diff --git a/vendor/google.golang.org/api/storage/v1/storage-gen.go b/vendor/google.golang.org/api/storage/v1/storage-gen.go
index 6a5db35fa..b4d425e59 100644
--- a/vendor/google.golang.org/api/storage/v1/storage-gen.go
+++ b/vendor/google.golang.org/api/storage/v1/storage-gen.go
@@ -1257,6 +1257,90 @@ func (s *BucketAccessControls) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
+// BucketStorageLayout: The storage layout configuration of a bucket.
+type BucketStorageLayout struct {
+ // Bucket: The name of the bucket.
+ Bucket string `json:"bucket,omitempty"`
+ // CustomPlacementConfig: The bucket's custom placement configuration for
+ // Custom Dual Regions.
+ CustomPlacementConfig *BucketStorageLayoutCustomPlacementConfig `json:"customPlacementConfig,omitempty"`
+ // HierarchicalNamespace: The bucket's hierarchical namespace configuration.
+ HierarchicalNamespace *BucketStorageLayoutHierarchicalNamespace `json:"hierarchicalNamespace,omitempty"`
+ // Kind: The kind of item this is. For storage layout, this is always
+ // storage#storageLayout.
+ Kind string `json:"kind,omitempty"`
+ // Location: The location of the bucket.
+ Location string `json:"location,omitempty"`
+ // LocationType: The type of the bucket location.
+ LocationType string `json:"locationType,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "Bucket") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Bucket") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s *BucketStorageLayout) MarshalJSON() ([]byte, error) {
+ type NoMethod BucketStorageLayout
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// BucketStorageLayoutCustomPlacementConfig: The bucket's custom placement
+// configuration for Custom Dual Regions.
+type BucketStorageLayoutCustomPlacementConfig struct {
+ // DataLocations: The list of regional locations in which data is placed.
+ DataLocations []string `json:"dataLocations,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "DataLocations") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "DataLocations") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s *BucketStorageLayoutCustomPlacementConfig) MarshalJSON() ([]byte, error) {
+ type NoMethod BucketStorageLayoutCustomPlacementConfig
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// BucketStorageLayoutHierarchicalNamespace: The bucket's hierarchical
+// namespace configuration.
+type BucketStorageLayoutHierarchicalNamespace struct {
+ // Enabled: When set to true, hierarchical namespace is enabled for this
+ // bucket.
+ Enabled bool `json:"enabled,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Enabled") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Enabled") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s *BucketStorageLayoutHierarchicalNamespace) MarshalJSON() ([]byte, error) {
+ type NoMethod BucketStorageLayoutHierarchicalNamespace
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
// Buckets: A list of buckets.
type Buckets struct {
// Items: The list of items.
@@ -4350,6 +4434,123 @@ func (c *BucketsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, err
return ret, nil
}
+type BucketsGetStorageLayoutCall struct {
+ s *Service
+ bucket string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// GetStorageLayout: Returns the storage layout configuration for the specified
+// bucket. Note that this operation requires storage.objects.list permission.
+//
+// - bucket: Name of a bucket.
+func (r *BucketsService) GetStorageLayout(bucket string) *BucketsGetStorageLayoutCall {
+ c := &BucketsGetStorageLayoutCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.bucket = bucket
+ return c
+}
+
+// Prefix sets the optional parameter "prefix": An optional prefix used for
+// permission check. It is useful when the caller only has storage.objects.list
+// permission under a specific prefix.
+func (c *BucketsGetStorageLayoutCall) Prefix(prefix string) *BucketsGetStorageLayoutCall {
+ c.urlParams_.Set("prefix", prefix)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BucketsGetStorageLayoutCall) Fields(s ...googleapi.Field) *BucketsGetStorageLayoutCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an optional parameter which makes the operation fail if the
+// object's ETag matches the given value. This is useful for getting updates
+// only after the object has changed since the last request.
+func (c *BucketsGetStorageLayoutCall) IfNoneMatch(entityTag string) *BucketsGetStorageLayoutCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BucketsGetStorageLayoutCall) Context(ctx context.Context) *BucketsGetStorageLayoutCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BucketsGetStorageLayoutCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BucketsGetStorageLayoutCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ if c.ifNoneMatch_ != "" {
+ reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
+ }
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/storageLayout")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("GET", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "bucket": c.bucket,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "storage.buckets.getStorageLayout" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *BucketStorageLayout.ServerResponse.Header or (if a response was returned at
+// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
+// check whether the returned error was because http.StatusNotModified was
+// returned.
+func (c *BucketsGetStorageLayoutCall) Do(opts ...googleapi.CallOption) (*BucketStorageLayout, error) {
+ gensupport.SetOptions(c.urlParams_, opts...)
+ res, err := c.doRequest("json")
+ if res != nil && res.StatusCode == http.StatusNotModified {
+ if res.Body != nil {
+ res.Body.Close()
+ }
+ return nil, gensupport.WrapError(&googleapi.Error{
+ Code: res.StatusCode,
+ Header: res.Header,
+ })
+ }
+ if err != nil {
+ return nil, err
+ }
+ defer googleapi.CloseBody(res)
+ if err := googleapi.CheckResponse(res); err != nil {
+ return nil, gensupport.WrapError(err)
+ }
+ ret := &BucketStorageLayout{
+ ServerResponse: googleapi.ServerResponse{
+ Header: res.Header,
+ HTTPStatusCode: res.StatusCode,
+ },
+ }
+ target := &ret
+ if err := gensupport.DecodeResponse(target, res); err != nil {
+ return nil, err
+ }
+ return ret, nil
+}
+
type BucketsInsertCall struct {
s *Service
bucket *Bucket
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 140dd0fdb..d189f208f 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -1,10 +1,10 @@
-# cloud.google.com/go v0.113.0
-## explicit; go 1.19
+# cloud.google.com/go v0.114.0
+## explicit; go 1.20
cloud.google.com/go/internal
cloud.google.com/go/internal/optional
cloud.google.com/go/internal/trace
cloud.google.com/go/internal/version
-# cloud.google.com/go/auth v0.4.2
+# cloud.google.com/go/auth v0.5.1
## explicit; go 1.20
cloud.google.com/go/auth
cloud.google.com/go/auth/credentials
@@ -36,7 +36,7 @@ cloud.google.com/go/storage
cloud.google.com/go/storage/internal
cloud.google.com/go/storage/internal/apiv2
cloud.google.com/go/storage/internal/apiv2/storagepb
-# github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1
+# github.com/Azure/azure-sdk-for-go/sdk/azcore v1.12.0
## explicit; go 1.18
github.com/Azure/azure-sdk-for-go/sdk/azcore
github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource
@@ -62,7 +62,7 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing
## explicit; go 1.18
github.com/Azure/azure-sdk-for-go/sdk/azidentity
github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal
-# github.com/Azure/azure-sdk-for-go/sdk/internal v1.8.0
+# github.com/Azure/azure-sdk-for-go/sdk/internal v1.9.0
## explicit; go 1.18
github.com/Azure/azure-sdk-for-go/sdk/internal/diag
github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo
@@ -128,7 +128,7 @@ github.com/VividCortex/ewma
# github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9
## explicit; go 1.15
github.com/alecthomas/units
-# github.com/aws/aws-sdk-go v1.53.8
+# github.com/aws/aws-sdk-go v1.53.18
## explicit; go 1.19
github.com/aws/aws-sdk-go/aws
github.com/aws/aws-sdk-go/aws/auth/bearer
@@ -172,7 +172,7 @@ github.com/aws/aws-sdk-go/service/sso/ssoiface
github.com/aws/aws-sdk-go/service/ssooidc
github.com/aws/aws-sdk-go/service/sts
github.com/aws/aws-sdk-go/service/sts/stsiface
-# github.com/aws/aws-sdk-go-v2 v1.27.0
+# github.com/aws/aws-sdk-go-v2 v1.27.1
## explicit; go 1.20
github.com/aws/aws-sdk-go-v2/aws
github.com/aws/aws-sdk-go-v2/aws/arn
@@ -204,10 +204,10 @@ github.com/aws/aws-sdk-go-v2/internal/timeconv
## explicit; go 1.20
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi
-# github.com/aws/aws-sdk-go-v2/config v1.27.15
+# github.com/aws/aws-sdk-go-v2/config v1.27.17
## explicit; go 1.20
github.com/aws/aws-sdk-go-v2/config
-# github.com/aws/aws-sdk-go-v2/credentials v1.17.15
+# github.com/aws/aws-sdk-go-v2/credentials v1.17.17
## explicit; go 1.20
github.com/aws/aws-sdk-go-v2/credentials
github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds
@@ -216,23 +216,23 @@ github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client
github.com/aws/aws-sdk-go-v2/credentials/processcreds
github.com/aws/aws-sdk-go-v2/credentials/ssocreds
github.com/aws/aws-sdk-go-v2/credentials/stscreds
-# github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.3
+# github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.4
## explicit; go 1.20
github.com/aws/aws-sdk-go-v2/feature/ec2/imds
github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config
-# github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.20
+# github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.23
## explicit; go 1.20
github.com/aws/aws-sdk-go-v2/feature/s3/manager
-# github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.7
+# github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.8
## explicit; go 1.20
github.com/aws/aws-sdk-go-v2/internal/configsources
-# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.7
+# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.8
## explicit; go 1.20
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2
# github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0
## explicit; go 1.20
github.com/aws/aws-sdk-go-v2/internal/ini
-# github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.7
+# github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.8
## explicit; go 1.20
github.com/aws/aws-sdk-go-v2/internal/v4a
github.com/aws/aws-sdk-go-v2/internal/v4a/internal/crypto
@@ -240,35 +240,35 @@ github.com/aws/aws-sdk-go-v2/internal/v4a/internal/v4
# github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2
## explicit; go 1.20
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding
-# github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.9
+# github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.10
## explicit; go 1.20
github.com/aws/aws-sdk-go-v2/service/internal/checksum
-# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.9
+# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.10
## explicit; go 1.20
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url
-# github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.7
+# github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.8
## explicit; go 1.20
github.com/aws/aws-sdk-go-v2/service/internal/s3shared
github.com/aws/aws-sdk-go-v2/service/internal/s3shared/arn
github.com/aws/aws-sdk-go-v2/service/internal/s3shared/config
-# github.com/aws/aws-sdk-go-v2/service/s3 v1.54.2
+# github.com/aws/aws-sdk-go-v2/service/s3 v1.55.0
## explicit; go 1.20
github.com/aws/aws-sdk-go-v2/service/s3
github.com/aws/aws-sdk-go-v2/service/s3/internal/arn
github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations
github.com/aws/aws-sdk-go-v2/service/s3/internal/endpoints
github.com/aws/aws-sdk-go-v2/service/s3/types
-# github.com/aws/aws-sdk-go-v2/service/sso v1.20.8
+# github.com/aws/aws-sdk-go-v2/service/sso v1.20.10
## explicit; go 1.20
github.com/aws/aws-sdk-go-v2/service/sso
github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints
github.com/aws/aws-sdk-go-v2/service/sso/types
-# github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.2
+# github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.4
## explicit; go 1.20
github.com/aws/aws-sdk-go-v2/service/ssooidc
github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints
github.com/aws/aws-sdk-go-v2/service/ssooidc/types
-# github.com/aws/aws-sdk-go-v2/service/sts v1.28.9
+# github.com/aws/aws-sdk-go-v2/service/sts v1.28.11
## explicit; go 1.20
github.com/aws/aws-sdk-go-v2/service/sts
github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints
@@ -413,7 +413,7 @@ github.com/googleapis/gax-go/v2/internal
## explicit; go 1.21
github.com/grafana/regexp
github.com/grafana/regexp/syntax
-# github.com/hashicorp/go-version v1.6.0
+# github.com/hashicorp/go-version v1.7.0
## explicit
github.com/hashicorp/go-version
# github.com/influxdata/influxdb v1.11.5
@@ -489,7 +489,7 @@ github.com/prometheus/client_golang/prometheus/testutil/promlint/validations
# github.com/prometheus/client_model v0.6.1
## explicit; go 1.19
github.com/prometheus/client_model/go
-# github.com/prometheus/common v0.53.0
+# github.com/prometheus/common v0.54.0
## explicit; go 1.20
github.com/prometheus/common/config
github.com/prometheus/common/expfmt
@@ -499,12 +499,12 @@ github.com/prometheus/common/version
# github.com/prometheus/common/sigv4 v0.1.0
## explicit; go 1.15
github.com/prometheus/common/sigv4
-# github.com/prometheus/procfs v0.15.0
-## explicit; go 1.21
+# github.com/prometheus/procfs v0.15.1
+## explicit; go 1.20
github.com/prometheus/procfs
github.com/prometheus/procfs/internal/fs
github.com/prometheus/procfs/internal/util
-# github.com/prometheus/prometheus v0.52.0
+# github.com/prometheus/prometheus v0.52.1
## explicit; go 1.21
github.com/prometheus/prometheus/config
github.com/prometheus/prometheus/discovery
@@ -602,11 +602,11 @@ go.opencensus.io/trace
go.opencensus.io/trace/internal
go.opencensus.io/trace/propagation
go.opencensus.io/trace/tracestate
-# go.opentelemetry.io/collector/featuregate v1.8.0
-## explicit; go 1.21
+# go.opentelemetry.io/collector/featuregate v1.9.0
+## explicit; go 1.21.0
go.opentelemetry.io/collector/featuregate
-# go.opentelemetry.io/collector/pdata v1.8.0
-## explicit; go 1.21
+# go.opentelemetry.io/collector/pdata v1.9.0
+## explicit; go 1.21.0
go.opentelemetry.io/collector/pdata/internal
go.opentelemetry.io/collector/pdata/internal/data
go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/logs/v1
@@ -622,8 +622,8 @@ go.opentelemetry.io/collector/pdata/internal/otlp
go.opentelemetry.io/collector/pdata/pcommon
go.opentelemetry.io/collector/pdata/pmetric
go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp
-# go.opentelemetry.io/collector/semconv v0.101.0
-## explicit; go 1.21
+# go.opentelemetry.io/collector/semconv v0.102.1
+## explicit; go 1.21.0
go.opentelemetry.io/collector/semconv/v1.6.1
# go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0
## explicit; go 1.21
@@ -667,7 +667,7 @@ go.uber.org/goleak/internal/stack
# go.uber.org/multierr v1.11.0
## explicit; go 1.19
go.uber.org/multierr
-# golang.org/x/crypto v0.23.0
+# golang.org/x/crypto v0.24.0
## explicit; go 1.18
golang.org/x/crypto/chacha20
golang.org/x/crypto/chacha20poly1305
@@ -678,10 +678,10 @@ golang.org/x/crypto/internal/alias
golang.org/x/crypto/internal/poly1305
golang.org/x/crypto/pkcs12
golang.org/x/crypto/pkcs12/internal/rc2
-# golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842
+# golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8
## explicit; go 1.20
golang.org/x/exp/constraints
-# golang.org/x/net v0.25.0
+# golang.org/x/net v0.26.0
## explicit; go 1.18
golang.org/x/net/http/httpguts
golang.org/x/net/http/httpproxy
@@ -690,7 +690,7 @@ golang.org/x/net/http2/hpack
golang.org/x/net/idna
golang.org/x/net/internal/timeseries
golang.org/x/net/trace
-# golang.org/x/oauth2 v0.20.0
+# golang.org/x/oauth2 v0.21.0
## explicit; go 1.18
golang.org/x/oauth2
golang.org/x/oauth2/authhandler
@@ -707,12 +707,12 @@ golang.org/x/oauth2/jwt
## explicit; go 1.18
golang.org/x/sync/errgroup
golang.org/x/sync/semaphore
-# golang.org/x/sys v0.20.0
+# golang.org/x/sys v0.21.0
## explicit; go 1.18
golang.org/x/sys/cpu
golang.org/x/sys/unix
golang.org/x/sys/windows
-# golang.org/x/text v0.15.0
+# golang.org/x/text v0.16.0
## explicit; go 1.18
golang.org/x/text/secure/bidirule
golang.org/x/text/transform
@@ -721,7 +721,7 @@ golang.org/x/text/unicode/norm
# golang.org/x/time v0.5.0
## explicit; go 1.18
golang.org/x/time/rate
-# google.golang.org/api v0.181.0
+# google.golang.org/api v0.183.0
## explicit; go 1.20
google.golang.org/api/googleapi
google.golang.org/api/googleapi/transport
@@ -739,15 +739,15 @@ google.golang.org/api/transport
google.golang.org/api/transport/grpc
google.golang.org/api/transport/http
google.golang.org/api/transport/http/internal/propagation
-# google.golang.org/genproto v0.0.0-20240521202816-d264139d666e
+# google.golang.org/genproto v0.0.0-20240604185151-ef581f913117
## explicit; go 1.20
google.golang.org/genproto/googleapis/type/date
google.golang.org/genproto/googleapis/type/expr
-# google.golang.org/genproto/googleapis/api v0.0.0-20240521202816-d264139d666e
+# google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117
## explicit; go 1.20
google.golang.org/genproto/googleapis/api
google.golang.org/genproto/googleapis/api/annotations
-# google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e
+# google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117
## explicit; go 1.20
google.golang.org/genproto/googleapis/rpc/code
google.golang.org/genproto/googleapis/rpc/errdetails